Why not just create computed attribute for each specific value that you want to extract and use standard bitmask check?
because traccar gives me a deciamal value over all bits....
eg: 4294966271 instead of 1111 1111 1111 1111 1111 1011 1111 1111
How is that relevant? It's an integer and you can apply a mask to it.
I can't follow your idea. How would you do it?
I thought I've to vonvert the dezimal value to binary and only then, I will able to get each value of the 16bits...
Computers only operate in binary data. Internally all integers are binary.
Let's say you want to check bit number 2, you can do something like this:
value & 0b100 != 0
Ok, thank you for the idea!
I will try it!!
I've tried some ideas, but non worked
0b100 will not accepted from the parser, only 0x100
Therefor I had to convert the 0b100 to dec (=4) and do the logical AND
my code:
status ? ( status & 4 ) != 0 ? "0" : "1" : null
Type String
Thank you for the idea!
Do you have a donation-link?
Done form eagleeye@c****o.at
Thank you!
Hi,
I'm using Traccar 4.10
My device reports status 4294966271 (dezimal) but I need it on binary. Each bit gives me a differnet spezific state (oil cut off, battery remove, ...).
I've tried to convert the dezimal to binary (with mod operator) bit I can't even get a simple loop to run.
Are there any restrictions at the computed attributes?
Normaly I would write in C++ something like:
What is the coorect way to output a value on jexl?
Regards
Chris