| 207 | } |
| 208 | |
| 209 | uint8_t lasType(Dimension::Type type, int fieldCnt) |
| 210 | { |
| 211 | if (fieldCnt < 1 || fieldCnt > 3) |
| 212 | return 0; |
| 213 | |
| 214 | uint8_t lastype = 0; |
| 215 | for (size_t i = 0; i < sizeof(lastypes) / sizeof(lastypes[0]); ++i) |
| 216 | if (type == lastypes[i]) |
| 217 | { |
| 218 | lastype = i; |
| 219 | break; |
| 220 | } |
| 221 | |
| 222 | // 0 is the "undocumented" type, which we don't really support. |
| 223 | if (lastype == 0) |
| 224 | return 0; |
| 225 | return 10 * (fieldCnt - 1) + lastype; |
| 226 | } |
| 227 | |
| 228 | |
| 229 | void ExtraBytesIf::setType(uint8_t lastype) |