Lilly
06/29/2021, 10:19 PMNikky
06/30/2021, 10:29 AMgroupBy
the parameter type so you have a data structure like:
Map<ParameterType, List<Parameter>>
that should make lookups slightly nicer
if each key can only appear once.. then you can convert the list of pairs to a map as wellLilly
06/30/2021, 2:48 PMare those separate executables?No. Just imagine you have connected to a bluetooth classic device and you get a bunch of bytearrays ("packets") whereas one packet has a specific format: ParameterName as String, ParameterNameLength as Int, DataLength as Int, Data as ByteArray --> this represents 1 Parameter When all packets have been arrived, I parse them to get a
Map<String, ByteArray>
. The problem is that I get hundreds of Parameter but not grouped, e.g. grouped by Parameter that are not "Configurable" and are just "Status" Parameter. You have to know that the communication is bidirectional, that says, after modifying the configurable Parameters (some are just 0x00 or 0x01 boolean flags to enable/disable something on the bt device), I have to send them back to the device.
I have problems with the huge amount of Parameter and grouping them for the UI. How do I know which of them are for example of category "Status" and which are "Configurable". I would have to name every single "Status" Parameter. That is what I'm currently doing. I have a List of Status Parameter in memory, a list of Configurable Parameter and so on (I have multiple such lists, cluttered across the app). I'm looking for a solution to have just 1 big table (data structure) where all Parameter are listed but with more information and where I can apply complex grouping, filtering, so I don't need to have multiple lists all over the app to do grouping/filtering. This one big table can be a database or a JSON file and the access would be a one-way (read-only). I thought the serialization lib is also for deserialization. I don't want to serialize anything