(entry: UdsInboxEntry)
| 310 | } |
| 311 | |
| 312 | function enqueueInboxEntry(entry: UdsInboxEntry): boolean { |
| 313 | const entryBytes = getMessageBytes(entry.message) |
| 314 | if ( |
| 315 | entryBytes > MAX_UDS_FRAME_BYTES || |
| 316 | inbox.length >= MAX_UDS_INBOX_ENTRIES || |
| 317 | inboxBytes + entryBytes > MAX_UDS_INBOX_BYTES |
| 318 | ) { |
| 319 | logError( |
| 320 | new Error( |
| 321 | `[udsMessaging] inbox full (${inbox.length}/${MAX_UDS_INBOX_ENTRIES}, ${inboxBytes}/${MAX_UDS_INBOX_BYTES} bytes); dropping message type=${entry.message.type}`, |
| 322 | ), |
| 323 | ) |
| 324 | return false |
| 325 | } |
| 326 | inbox.push(entry) |
| 327 | inboxBytes += entryBytes |
| 328 | return true |
| 329 | } |
| 330 | |
| 331 | function ensureAuthToken(): string { |
| 332 | if (!authToken) { |
no test coverage detected