Hi guys,
so i read through the post here and think i understood most of the stuff: http://e2e.ti.com/support/low_power_rf/f/660/t/84691.aspx.
I was able to connect my ez430 target board wirelessly (so without the usb dongle) to my laptop (i have a bt adapter built into my laptop) by modifying appl_sdk.h (YAY!). For starters just to test that i can wirelessly send data correctly i changed the contents of appl_acceleromenter_read_spp_send. I simply replaced it with:
void appl_acceleromenter_read_spp_send(UCHAR dev_index)
{
/* sdk_accelerometer_read(appl_accelerometer_buffer,
sizeof(appl_accelerometer_buffer)
);
appl_spp_write(dev_index, appl_accelerometer_buffer,
sizeof(appl_accelerometer_buffer)
);
*/
UCHAR test[4];
test[0]= 00000000;
test[1]=00000000;
test[2]=00000000;
test[3]=00000000;
appl_spp_write(dev_index, test,
sizeof(test)
);
}
So basically, im just sending it a bunch of zero's. I use the included keyboard gen app to test the incoming data from the target board. I had to modify the keyboard gen since it expects accelerometer data and thus behaves as so. I got microsoft visual studios 2010 C++ to modify the keyboard_events_generator.c (is there a better way?) i debugged and built the appl so that it is changed to reflect what i want...just printing the raw data (which should all be zero's). I notice that the code that prints the data is mostly in the if (packet_pointer == 4) statement that starts at line 593 in the program. My modified if (packet_pointer== 4) statement is found at the end of this post.
Despite changing the keyboard gen code to print raw data (or at least so i think) im not getting the right data outputted from the command console. i changed the comport.txt file to the com port that my bt device was assigned (7). Despite this this is what im getting in my command console from the keyboard_events appl:
Ignore the final result data part.
packet 0 data = 0, packet 1 data = 0
packet 2 data = 0,packet 3 data = 0
final result data = 0
packet 0 data = 0, packet 1 data = 85
packet 2 data = 85, packet 3 data = 5
final result data = 21765
packet 0 data = 0, packet 1 data = 0
packet 2 data = 0,packet 3 data = 0
final result data = 0
packet 0 data = 0, packet 1 data = 85
packet 2 data = 85, packet 3 data = 5
final result data = 21765
packet 0 data = 0, packet 1 data = 0
packet 2 data = 0, packet 3 data = 0
final result data = 0
The first set of data is always correct..but then the data turns inconsistent alternating between outputting zero's or 85's and 5's..I've attached my modified keyboard_events.c code as well. Can someone please help me?? Perhaps there is an easier way to print out the raw data from my target board? Im not really familiar with using hyperterminal or putty with bluetooth..
if (packet_pointer == 4) // Complete Packet
{
/* Valid Packet */
/* Reset pointer for next packet */
packet_pointer = 0;
toread = 4;
printf ("packet 0 data = %ld, packet 1 data = %ld\n", packet[0], packet[1]);
printf ("packet 2 data = %ld, packet 3 data = %ld\n", packet[2], packet[3]);
pos_x = packet[0];
pos_x <<= 8;
pos_x |= packet[1];
pos_x <<=8;
pos_x |= packet[2];
pos_x <<= 8;
pos_x |= packet[3];
printf ("final result data = %ld\n", pos_x);
}