Hello,
I was "playing" with some BLE sensors (Blue Coin T from ELA) and I have seen (here : https://wiki.teltonika.lt/view/FMB_AVL_ID) that there are data which length are variable.
For exemple Beacon (ID 385) and BLE Sensors (ID 331 -> 334) data.
Values can have different length, but they are also Hexadecimal values or ASCII strings. For example it should be interesting to get string value instead of hexadecimal or number for ISO6709 Coordinates (ID 387).
Next, my goal is to put it in database. However I get "0" value.
Thus, my problem is inside of the Codec8E.cs class which can be found here : Teltonika.Parser (source code) > Teltonika.Codec > Codecs > Codec8E.cs.
This is the last block of code of the Codec8E.cs file.
If we look at IoProperty.Create() methode, value is a "long" variable.
And if we look at ReadBytes() C# method, it return an array of bytes.
When I have "translated" this code to java, I hadn't paid attention to this problem.
I can't put bytes array in a long value and mostly if I want to get hexadecimal or string value.
In addition, I have seen that in the Teltonika Data Parser, there is no string value for the "ISO6709 Coordinates" data... only extracted bytes.
So...I think I am at the same level as the Teltonika data parser... I am blocked at this moment. :/
Do you have idea of how to extract string properly from data in order to put it in a database ?
I have a method to convert bytes array to HEX or String value. This is not the problem.
It is very... "How to do properly without destroying the clean teltonika structure ?"
Also, I am already able to store all other numeric values or hexadecimal values that represents numbers.
This is only variables values length which mainly represents string which are difficult to treat and store.
Sorry for this fairly technical problem... Meanwhile, I will continue to search a solution. :)
Thanks a lot for your help,
Sincerely,
AlliageSphere
EDIT 1 : Maybe I can make an other IoProperty class to manage only strings...
Thus. I have to get the variable type of the data and after, I will redirect the data value and id to IoPropertyNumeric or IoPropertyString. It should work ! :D
But I don't know if there will be some issues after...So, I will try it this afternoon. ^^
I will keep you posted.