This page shows some code examples you can use to develop your own solutions. All this examples are released under the Apache V2 License IndexSlave Related Code- Micro Slave: A simple code that opens the slave port on discoverable mode and accepts all the incoming connections. It will teach you how to open the slave channel, how to make slave connections, and how to use debugging.
- Little Slave: Like the micro slave, but now it will open the shell if the user press "+" when the connection is firstly started. It will teach you how to handle input characters, how to open shell connections and finally will introduce Leds handling.
- Industrial XR3 and XR5 ready slave code
- Filtered Service Slave: A more complex mode, it will open the port in discoverable mode, but will check that those who want to connect to this peer complies with an address pattern. It will teach you how to compare string, and reject incoming connections.
- Restrictive Slave: This is a piece of code taken from our command line, that will pair to a device, and then will apair invisible to all the other devices. It will teach you how to make an slave device discover and undiscoverable.
- Improved Slave: This is another slave example, it ensures slave profile availability almost 100% of the time.
Master Related Code- Mini Master: This code will make inquires, and once it found a device it will try to connect, once the connection is closed it will start the process again. This will teach you how to handle alarms, make inquires, handle inquires results, make master connection, and check master connections.
- Filtered Service Master: This code will make inquires, and if the device it discovers matches a given pattern it will make a connection, once the connection is lost it will connect to the first thing it can find. It will teach you how to work with inquires showing how sensitive they are.
- Listed Master: Those interested on buying AIRcable Mini or SMD can be very interested in this code. This code will have a predefined list of devices (between 0 and 48), will open a connection to each one of this (one at the time), will make some work over the connection, will close the connection and will continue with the next device, all this on an endless working cycle. It will teach you how to use PRINT and close master connections from the master side.
- Cable Master: This code is like our Cable Master, it will make inquires and will pair with the first device it can find. Once it is paired it will not inquiry any more and will only connect to it's peer. This code will show you a way to handle pairs from the master side.
Interactive Code- Interactive Code: Sometimes you need an interactive shell on the other side, this code will teach you how to write a simple interactive program that will let the user control a series of leds and will read some analog/digital inputs.
- Wireless Command Line: This is a modified version of the command line version 0.5 that uses SPP for the command line instead of the UART.
Networking- Relay Mode Code: This code will show you how easy is to create a network of AIRcable devices. For this example you will need at least 3 different bluetooth devices, and one of those 3 must be an AIRcable OS enabled device. In this mode the AIRcable OS device will be connected to two other devices and will make a bridge between them, this way you can make the range of your bluetooth devices much longer.
- DUN SPP: This example shows you how to switch between SPP and DUN profiles.
Hardware Interfacing- GPS and Data Logging: In this example we will get connected to a Bluetooth Enabled GPS and will log all the data to a file.
- vCard Sender: In this brief example we will show you how to create an automatic vCard sender.
- SMS Sender: This example will show you how to generate SMS messages on a BT enabled cell phone, and send them.
- I2C Example: The AIRcable OS can communicate with any I2C device. This example uses the MCP3421 18bit ADC to read temperatures from a type-K thermocouple.
Miscellaneous- Bitwise Operations: There are times when you need to do some bitwise operations, for example when you need to calculate a checksum, here we will show some bitwise operations implementations.
- Publisher: Proximity Marketing with the AIRcable OS
- Rssi Scanner: A piece of code that will start RSSI inquiry when it gets an SPP connection, printing results in the slave channel.
Future Examples- Advanced Uart: This example read from Uart and writte to SPP, via BASIC program
- UART Interrupting: doing reads and writes manually with @UART interrupts
- Timing: attach clock, use time functions
- Analog Interface: read from analog 1 and 2, a battery monitor that blinks when battery is low
- Temperature Sensor: temperature sensor and use @SENSOR
- I2C Interface: use the i2c function to talk to an ADC ads1112
- Having Some Fun: make some noise with a speaker
|
Wiki Pages now support comments, you can leave us your questions here. We'll reply them soon.
Hi! I'm interested in connecting the wiimote (the Wii controller) to a microcontroller which has a serial port (rs232).
To connect to wiimote you've to establish a L2CAP link. Could any aircable do this kind of link?
Thanks
Hi,
Sorry but you can't use the AIRcable for that. The wiimote behaves as a mouse, and then uses the hid profile, which we don't support on the device right now.
Thanks Manuel
Hi Would you be so kind as to answer some questions? Basically i want to read a sensor from the analog input every 200 ms for 30 seconds and multiply these values with a certain parameter writen in a txt file and store these values into a txt file and send it through ftp to my laptop in order to analyze the info.I have some troubles with the file instruction set, i don't know if I have to declare something before, or maybe i am using wrong the instructions, the manual just explain what the instruction is supposed to do. a) For example, how can i read the analog input, the manual just says that i will receive a string with the analog input, temperature and so on, but how should i write the instruction ? Which instructions should i declare in the beginning? b) I wrote some programs The program i wrote first is supposed to create a txt file and write "3" in the position 3, "5 y 9" in the position 5,1 in the position 1 and "\n" in the position 4, but the program just creates a file and writes "5 y 9" in the beginning of the text file, part o the code that I am using is: 1) @MAIN 100 100 A = pioclr J 101 A = pioset J 102 A = pioclr J 103 A = append "Nuevo.txt" 104 $0 = "3" 105 P = $0 106 A = seek 3 107 A = write P 108 $0 = "5 Y 9" 109 L = $0 110 A = seek 5 111 A = write L 112 Y = 1 113 A = seek 1 114 A = write "1" 116 $0 = "\n" 117 P = $0 118 A = seek 4 119 P = $0 120 A = write P 133 A = rename "Tabla.txt" 134 A = close 2) In the next program is supossed to read info from one file and paste into a new one, the aircable doesnt even create the file : 103 A = append "param.txt" 0 REM READS DATE 8 104 B = seek 16 105 B = read (8) 106 $4 = $0 0 REM READS SERIAL NUM 8 107 A = seek 58 108 A = read (8) 109 $3 = $0 0 REM READS NAME 113 A = seek 87 114 A = read (10) 115 A = close 116 $2 = "Dems.txt" 117 A = append $2 120 A = seek 5 121 A = write M 124 A = close 125 wait 10 126 A = pioclr J 127 A = pioset J 128 A = append $2 0 REM writes date 129 A = seek 1 130 A = write $4 0 REM writes serial 131 A = seek 11 132 A = write $3 133 A = seek 15 0 REM writes name of file 134 A = write $2 136 A = close
I hope you have some time to answer these questions.
Sorry but we can't read what you wrote, could you be so kind to use the google group:
http://groups.google.com/group/aircable