Code Monkey home page Code Monkey logo

plutocon_alarm's Introduction

Plutocon SDK

Relases

- 1.5.3

  • Add PacketFormat Property(for A1.6.0)
  • You can choose KongTech Format or iBeacon Format(iBeacon format is not detected in iOS Plutocon)

- 1.5.2

  • Change minimum adv interval to 20ms(for A1.3.0)

- 1.5.1

  • Change the maximum length of device name to 14

- 1.5.0

  • Change gradle version
  • Remove Plutocon Service
  • Add Software version detail
  • Add JavaDoc PlutoconEditor
  • Change TxLevel list [-40, -30, -20, -16, -12, -8, -4, 0, 4]
  • Prevent change TxLevel in Software version A1.1.0

Installation

Gradle via jCenter

Declare in your Gradle's build.gradle dependency to this library.

repositories {
	jcenter()
}

dependencies {
	compile 'com.kongtech.plutocon.sdk:plutocon_sdk:1.5.3'
}

Permissions

Basic permissions

The following permissions are included in the sdk

  • 'android.permission.BLUETOOTH'
  • 'android.permission.BLUETOOTH_ADMIN'

Android 6.0 runtime permissions

  • If running on Android 6.0 or later, Location Services must be turned on.
  • If running on Android 6.0 or later and your app is targeting SDK >= 23 (M), any location permission (ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION must be granted.

Tutorials

Quick start for monitoring plutocons

private PlutoconManager plutoconManager;

// Initialization
plutoconManager = new PlutoconManager(context, macAddress);

// Start monitoring foreground(fastest scan) with listener
plutoconManager.startMonitoring(PlutoconManager.MONITORING_FOREGROUND, new PlutoconManager.OnMonitoringPlutoconListener() {
	@Override
	public void onPlutoconDiscovered(Plutocon plutocon, List<Plutocon> plutocons) {
		//do something	
	}
});

// Start monitoring background(normal scan)
plutoconManager.startMonitoring(PlutoconManager.MONITORING_BACKGROUND, new PlutoconManager.OnMonitoringPlutoconListener() {
	@Override
	public void onPlutoconDiscovered(Plutocon plutocon, List<Plutocon> plutocons) {
		//do something	
	}
});

// Stop Monitoring
plutoconManager.stopMonitoring();

Quick start for connecting plutocon

// Initialization
PlutoconConnection plutoconConnection = new PlutoconConnection(context);

// Connect to plutocon
plutoconConnection.connect(new PlutoconConnection.OnConnectionStateChangeCallback() {
	@Override
	public void onConnectionStateDisconnected() {
		//do something		
	}

	@Override
	public void onConnectionStateConnected() {
		//do something		
	}
});

// Read plutocon property
plutoconConnection.getMajor();
plutoconConnection.getMinor();
plutoconConnection.getPacketFormat();

plutoconConnection.getBatteryVoltage();
plutoconConnection.getBroadcastingPower();
plutoconConnection.getAdvertisingInterval();

plutoconConnection.getUuid();
plutoconConnection.getLatitude();
plutoconConnection.getLongitude();

plutoconConnection.getSoftwareVersion();
plutoconConnection.getSoftwareVersionDetail();
plutoconConnection.getHardwareVersion();
plutoconConnection.getManufactureName();
plutoconConnection.getModelNumber();

// Disconnect from plutocon
plutoconConnection.disconnect();

Quick start for edit plutocon property

PlutoconEditor editor = plutoconConnection.editor();
editor
	.setGeofence(latitude, longitude)
	.setProperty(uuid, value)
	.setUUID(uuid)
	.setPacketFormat(packetFormat)
	.setOnOperationCompleteCallback(new PlutoconOperator.OnOperationCompleteCallback() {
		@Override
		public void onOperationComplete(BluetoothGattCharacteristic characteristic, boolean isLast) {
			//do something
		}
	})
	.commit();

plutocon_alarm's People

Contributors

plutocon avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

xodyd jejusea

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.