Greetings!
So I’ve got an assignment to make an app to control Vex IQ from an android device (there’s actually more to it, but the connection to Vex is what I’m having trouble with). Here’s the scenario:
The phone’s paired with another device and advertising to your robot, and that’s where I ran into trouble. I’ve read your Smart Radio Developer Guide (SDK), but I still don’t quite understand the entire scenario.
There’s advert data:
// GAP - Advertisement data byte] advertData = {
// Flags; this sets the device to use limited discoverable
// mode (advertises for 30 seconds at a time) instead of general
// discoverable mode (advertises indefinitely)
0x02, // length of this data
0x01, // GAP_ADTYPE_FLAGS,
0x05, // DEFAULT_DISCOVERABLE_MODE | BREDR_NOT_SUPPORTED,
0x0B, // Length of the following data
//0xFF, // GAP_ADTYPE_MANUFACTURER_SPECIFIC,
-1, // GAP_ADTYPE_MANUFACTURER_SPECIFIC,
0x11, // VEX Company ID byte1
0x11, // VEX Company ID byte0
0x01, // MAJOR_VERSION of the radio firmware,
0x01, // MINOR_VERSION of the radio firmware,
0x06, // The following 32 bits are out SSN (Little Endian)
0x12, // Example SSN = 987654
0x0F,
0x00,
0x01, // MAJOR_VERSION of the peripheral’s software
0x05 // MINOR_VERSION of the peripheral’s software
};
Java’s bytes are always signed, therefore 0xFF will not compile. -1 should be the correct equivalent. Right?
Also, don’t worry, I’m changing the array to have correct vex_id values at runtime:
final byte] result = toByteArray(vexId);
advertData[9] = result[0];
advertData[10] = result[1];
advertData[11] = result[2];
advertData[12] = result[3];
Then there are three different UUID’s:
// JS_Data
static final String *UUID_STRING *= “08590F7E-DB05-467E-8757-72F6FAEB13B5”;
// Data_Brain_RX
static final String *UUID_STRING *= “08590F7E-DB05-467E-8757-72F6FAEB13F5”;
// Data_Brain_TX
static final String *UUID_STRING *= “08590F7E-DB05-467E-8757-72F6FAEB1306”;
To which one of these should I advertise the initial data? Should be JS_Data, right?
Everything is succesful, the advertisement went out. Now, what should happen at this point? Because nothing’s happening. Should I instantly send out another advertisement? What should the content of that be?
It would even be helpful if you could point me to the correct location in your iOS Objective-C samples.
Best wishes,
Niki