grasshopper
01-01-2009, 03:45 AM
I am creating a blue tooth object for the propeller and I am running into a bit of translation problems.
I implemented the LMX9838 Bluetooth IC from national and its a great device, so far my PC sees it and my propeller can reset it. I understand that I need to send data using the SSP protocal that requires a start bit, stop bit, check sum, the data, and the proper opcode. This all needs to be sent using Hex.
Problem 1.
I am using the full duplex serial object and need to know if this is the correct way to send hex using a dat table
ser.str(@establishlink)
ser.str(@DataSend)
DAT
establishlink Byte "02530A38"
portdata Byte "31353535353531"
I guess I could do this but I wanted more structure.
ser.hex($02_53_0A_38,8)
Problem 2.
The data sheet states that the check sum as the calculated low bytes of the sum of all bytes(starting from Packet type to and including data length). How do I understand this. For example my Establish Link Request is as follows:
1 2 3 4 5 6..................... 7
$02_53_0B_38_31_35_35_35_35_35_31
This is translated as
1. $02 = start of text
2. $53 = Packet Type or request
3. $0B = Opp Code for establish link
4. $38 = data length
5. $31 = Local Port or port 1
6. $35_35_35_35_35 = Blue tooth address
7. $31 = Remote Device port
So to get the check sum I add $53+$0b+$38 = $96? I think this is OK please let me know what you think?
Post Edited (grasshopper) : 2/9/2009 11:17:34 PM GMT
I implemented the LMX9838 Bluetooth IC from national and its a great device, so far my PC sees it and my propeller can reset it. I understand that I need to send data using the SSP protocal that requires a start bit, stop bit, check sum, the data, and the proper opcode. This all needs to be sent using Hex.
Problem 1.
I am using the full duplex serial object and need to know if this is the correct way to send hex using a dat table
ser.str(@establishlink)
ser.str(@DataSend)
DAT
establishlink Byte "02530A38"
portdata Byte "31353535353531"
I guess I could do this but I wanted more structure.
ser.hex($02_53_0A_38,8)
Problem 2.
The data sheet states that the check sum as the calculated low bytes of the sum of all bytes(starting from Packet type to and including data length). How do I understand this. For example my Establish Link Request is as follows:
1 2 3 4 5 6..................... 7
$02_53_0B_38_31_35_35_35_35_35_31
This is translated as
1. $02 = start of text
2. $53 = Packet Type or request
3. $0B = Opp Code for establish link
4. $38 = data length
5. $31 = Local Port or port 1
6. $35_35_35_35_35 = Blue tooth address
7. $31 = Remote Device port
So to get the check sum I add $53+$0b+$38 = $96? I think this is OK please let me know what you think?
Post Edited (grasshopper) : 2/9/2009 11:17:34 PM GMT