|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object at.abraxas.amarino.Amarino
public class Amarino
This class is part of the Amarino Library and bundles some very useful methods to communicate with Arduino.
Method Summary | |
---|---|
static void |
connect(Context context,
java.lang.String address)
Establish a connection to the Bluetooth device with the given address. |
static void |
disconnect(Context context,
java.lang.String address)
Disconnect from a Bluetooth device For feedback register a BroadcastReceiver for the AmarinoIntent.ACTION_DISCONNECTED intent. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
boolean data)
Used by plug-in developers to send a boolean value. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
boolean[] data)
Used by plug-in developers to send a boolean array. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
byte data)
Used by plug-in developers to send a byte value. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
byte[] data)
Used by plug-in developers to send a byte array. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
char data)
Used by plug-in developers to send a char value. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
char[] data)
Used by plug-in developers to send a char array. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
double data)
Used by plug-in developers to send a double value. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
double[] data)
Used by plug-in developers to send a double array. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
float data)
Used by plug-in developers to send a float value. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
float[] data)
Used by plug-in developers to send a float array. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
int data)
Used by plug-in developers to send a int value. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
int[] data)
Used by plug-in developers to send a int array. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
long data)
Used by plug-in developers to send a long value. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
long[] data)
Used by plug-in developers to send a long array. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
short[] data)
Used by plug-in developers to send a short array. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
java.lang.String data)
Used by plug-in developers to send a String value. |
static void |
sendDataFromPlugin(Context context,
int pluginId,
java.lang.String[] data)
Used by plug-in developers to send a String array. |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
boolean data)
Sends a boolean value to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
boolean[] data)
Sends an boolean array to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
byte data)
Sends a byte value to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
byte[] data)
Sends an byte array to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
char data)
Sends a char value to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
char[] data)
Sends a char array to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
double data)
Sends a double value to Arduino If you do not exactly know what you do, you absolutely shouldn't really use this method, since Arduino cannot receive Android's 32-bit double values. |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
double[] data)
Sends a double array to Arduino If you do not exactly know what you do, you absolutely shouldn't really use this method, since Arduino cannot receive Android's 32-bit double values. |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
float data)
Sends a float value to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
float[] data)
Sends a float array to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
int data)
Sends an int value to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
int[] data)
Sends an int array to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
long data)
Sends a long value to Arduino If you do not exactly know what you do, you absolutely shouldn't really use this method, since Arduino cannot receive Android's 32-bit long values. |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
long[] data)
Sends a long array to Arduino If you do not exactly know what you do, you absolutely shouldn't really use this method, since Arduino cannot receive Android's 32-bit long values. |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
short data)
Sends a short value to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
short[] data)
Sends a short array to Arduino |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
java.lang.String data)
Sends a String to Arduino The buffer of an Arduino is small, your String should not be longer than 62 characters |
static void |
sendDataToArduino(Context context,
java.lang.String address,
char flag,
java.lang.String[] data)
Sends a String array to Arduino The buffer of an Arduino is small, your String should not be longer than 62 characters. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void connect(Context context, java.lang.String address)
AmarinoIntent.ACTION_CONNECT
to initiate a connection.
You might want to know if your connection was successful or not.
To get feedback from Amarino register a
BroadcastReceiver
for the following intents.
AmarinoIntent.ACTION_CONNECTED
AmarinoIntent.ACTION_DISCONNECTED
AmarinoIntent.ACTION_CONNECTION_FAILED
AmarinoIntent.ACTION_PAIRING_REQUESTED
connect(Context, String)
context
- the contextaddress
- address of your Arduino Bluetooth module
e.g. "00:06:54:4B:31:7E"
public static void disconnect(Context context, java.lang.String address)
AmarinoIntent.ACTION_DISCONNECTED
intent.
context
- the contextaddress
- address of your Arduino Bluetooth module, should be the same
which you used to connect to the devicepublic static void sendDataToArduino(Context context, java.lang.String address, char flag, boolean data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, byte data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, char data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, short data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, int data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, long data)
If you do not exactly know what you do, you absolutely shouldn't really use this method, since Arduino cannot receive Android's 32-bit long values.
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, float data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, double data)
If you do not exactly know what you do, you absolutely shouldn't really use this method, since Arduino cannot receive Android's 32-bit double values.
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, java.lang.String data)
The buffer of an Arduino is small, your String should not be longer than 62 characters
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, boolean[] data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, byte[] data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, char[] data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, short[] data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, int[] data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, long[] data)
If you do not exactly know what you do, you absolutely shouldn't really use this method, since Arduino cannot receive Android's 32-bit long values.
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, float[] data)
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, double[] data)
If you do not exactly know what you do, you absolutely shouldn't really use this method, since Arduino cannot receive Android's 32-bit double values.
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataToArduino(Context context, java.lang.String address, char flag, java.lang.String[] data)
The buffer of an Arduino is small, your String should not be longer than 62 characters.
context
- the contextaddress
- the Bluetooth device you want to send data toflag
- the flag Arduino has registered a function for to receive this datadata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, boolean data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, boolean data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, byte data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, byte data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, char data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, char data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, int data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, int data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, long data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, long data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, float data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, float data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, double data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, double data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, java.lang.String data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, String data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, boolean[] data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, boolean[] data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, byte[] data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, byte[] data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, char[] data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, char[] data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, short[] data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, short[] data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, int[] data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, int[] data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, long[] data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, long[] data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, float[] data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, float[] data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, double[] data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, double[] data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to sendpublic static void sendDataFromPlugin(Context context, int pluginId, java.lang.String[] data)
This method can only be used within a plugin!
If you want to send data from your own standalone application, use
sendDataToArduino(Context context, String address, char flag, String[] data)
instead.
context
- the contextpluginId
- you received this id whendata
- your data you want to send
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |