Skip to content

Communication protocols

Your Tap determines which protocols are available:

Your Tap may also be available through a relay (gateway), for example Tap Manager app. Additional communication protocols are available for this situation:

You can also implement a custom protocol.

Provided implementation

Bluetooth Low Energy (BLE)

Connect to bluetooth device with mac address C3:23:DE:AA:BB:CC

// Only available in node.js environment via noble library
import { NobleBLEAdapter, NobleBleScanner } from "@iotize/device-com-ble.node";


let bleScanner = new NobleBleScanner();
let peripheral: noble.Peripheral = await bleScanner.getDeviceByAddress(DEVICE_ADDRESS);
let bleProtocol = new NobleBLEAdapter(peripheral);

// From a bluetooth address
ComProtocol bleProtocol = BLEProtocol.fromAddress(context, "C3:23:DE:AA:BB:CC");

// If you already have an Android BluetoothDevice instance use this method:
BluetoothDevice bluetoothDevice = // ...
ComProtocol bleProtocol = BLEProtocol.fromDevice(context, bluetoothDevice);
// Not available yet

See javadoc for Android of BLEProtocol


Connect to an IoTize with an NFC tag:


// Suppose you have an NFC tag
android.nfc.Tag tag = // ...

// Instantiate the NFC protocol from this tag
ComProtocol nfcProtocol = NFCProtocol.create(tag);
// Not available yet

See javadoc for Android of NFCProtocol


For Wi-Fi communication, if you are connected on the same network as the IoTize, you can use this method to instantiate your communication object:

// With node environment, use sockets
import { SocketProtocol } from "@iotize/device-com-socket.node"
let protocol = new SocketProtocol({
    host: 'localhost',
    port: 2000

// With browser environment, use web sockets
import { WebSocketProtocol } from "@iotize/device-com-websocket.js"
let protocol = new WebSocketProtocol({
    url: 'tcp://localhost:2000'

// Socket protocol
ComProtocol socketProtocol = new SocketProtocol(new InetSocketAddress("<YOUR_IP_ADDRESS>", <PORT>));

// Wi-Fi protocol (for Tap with Wi-Fi capability)
// If we are already connected to the same network as the Tap:
ComProtocol wifiProtocol = WIFIProtocol.fromIP(context, "");

// To connect on a specific network, use WifiConfiguration wifiConfig;
// If you have an open network
wifiConfig = WIFIProtocol.createConfiguration("networkssid", WIFIProtocol.SecurityType.OPEN);
// Network with WPA key
wifiConfig = WIFIProtocol.createConfiguration("networkssid", WIFIProtocol.SecurityType.WPA, "wifipassord");
// Network with WEP key
wifiConfig = WIFIProtocol.createConfiguration("networkssid", WIFIProtocol.SecurityType.WEP, "wifipassord");

// Create the protocol with a specific network configuration
wifiProtocol = WIFIProtocol.fromIP(context, "", wifiConfig);
// Not available yet

See javadoc for Android of WIFIProtocol


import { MqttProtocol } from "@iotize/device-com-mqtt.js";
let protocol = new MqttProtocol();
// Not yet documented 

IoTizeMQTTClient mqttClient = new IoTizeMQTTClient("tcp://<yourbrokerurl>:<port>", "ClientId1", "/your/publish/topic");
MQTTProtocol protocol = new MQTTProtocol(mqttClient);

// Configure your protocol
    .subscribeToTopics(new String[]{
// Not available yet


Not yet available.

Create your own

To use your own protocol, implement interface ComProtocol (See javadoc for Android of ComProtocol)

import { ComProtocol } from '@iotize/device-client/protocol/api';

// Implement interface
class MyCustomProtocol implements ComProtocol{

    // Your implementation here


// You can also simply override QueueComProtocol
import { QueueComProtocol } from '@iotize/device-client/protocol/impl';

class MyCustomProtocol extends QueueComProtocol{


class MyCustomProtocol implements ComProtocol{

    // Your implementation here

import TapClientApi

class MyCustomProtocol: ComProtocol{

    // Your implementation here