I'd like to extend the BCE protocol to also be able to read out Datatype 6 which is used for special events. (like pulling out the plug of the device)
This datatype is pretty simple when I look in the documentation so I tried doing it myself, but I think I'm doing it wrong because I get things like functioncode 4123 and eventcode 1231:
int EVENT_DATA_TYPE = 6;
if(datatype == EVENT_DATA_TYPE){
Log.error("EVENT!");
Event event = new Event();
time = time >> 4 << 1;
time += 0x47798280; // 01/01/2008
Log.error("Event " + new Date(time * 1000));
event.setTime(new java.sql.Date(time * 1000));
int functionCode = buf.readUnsignedShort();
int eventCode = buf.readUnsignedShort();
Log.error("Event " + event.getTime() + " : " + eventCode + " " + functionCode);
}
else if (datatype == COORDINATE_DATA_TYPE) {
[..]
The protocol doc is found here: https://docs.google.com/document/d/1TZCsx4zYiEj6JWrDRXx-tK3We_9YaCQzyWoF-gmO8lk/edit
page 17 contains dt6.
Thanks in advance!
It seems like it has to be "byte", but you are reading "short".
I'd like to extend the BCE protocol to also be able to read out Datatype 6 which is used for special events. (like pulling out the plug of the device)
This datatype is pretty simple when I look in the documentation so I tried doing it myself, but I think I'm doing it wrong because I get things like functioncode 4123 and eventcode 1231:
The protocol doc is found here: https://docs.google.com/document/d/1TZCsx4zYiEj6JWrDRXx-tK3We_9YaCQzyWoF-gmO8lk/edit
page 17 contains dt6.
Thanks in advance!