-
Notifications
You must be signed in to change notification settings - Fork 28
Lite API: Companion
Parent Document: ANT APIs
Companion API comprises of connection-handling functions and message-transmission functions.
ANT framework supports communication with smartphone companion.
Companion API internally calls P2P communication functions to transmit the message requested by applications. As now, ANT Lite supports only Internet-based connection with companion device. P2P-based connection (ex. Bluetooth or Wi-Fi Direct) will be supported soon.
var companionAPI = require('ant').companion;
registerOnReciveMessage(Function handler);
registerOnReceiveMessage()
registers a function to be executed when a message is received.
-
handler
: Callback function
Boolean unregisterOnReceiveMessage(Function handler);
unregisterOnReceiveMessage()
removes a function to be executed when a message is received.
-
handler
: Callback function
String getMyIPAddress(String interfaceName);
getMyIPAddress()
returns the IP address of interfaceName
.
-
interfaceName
: Interface name
Boolean sendMessage(String message);
sendMessage()
sends a message.
-
message
: Message to send
- Home
- About
- Getting Started
-
ANT APIs
- ANT Classic API
- ANT Lite API
- Getting Involved