Reading and writing CBOR documents in pieces
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- c
- Área
- embedded-iot
Línea de trabajo
Revisa la API de decoder/parser y las rutas CborErrorAdvancePastEOF y CborErrorOutOfMemory descritas en el issue. Determina si se pueden admitir lecturas y escrituras reanudables con el comportamiento existente del puntero de lectura y del buffer; se considera terminado cuando exista un enfoque de streaming documentado y probado, o un diseño de API claro.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi,
Is it possible to parse and and emit a CBOR document in parts? The use case here is where I might have a CBOR file that's in the order of 2kB in size, but I don't want to allocate a 2kB buffer to read the whole thing in one go (I've allocated 4kB for a stack and don't have a lot of heap space available).
The thinking is when reading, I might allocate a 256 or 512-byte buffer (on the stack), read the first buffer-full worth of data, then call the parser on that. As I get near the end, I watch for CborErrorAdvancePastEOF… when this happens, I obtain a copy of TinyCBOR's read pointer, do a memmove to move the unread data to the start of my buffer, read some more in, then tell TinyCBOR to move back to the start of the buffer to resume reading whatever CBOR value was being pointed to at the time.
Likewise writing; when CborErrorOutOfMemory is encountered, I can do a write of the buffer, then tell TinyCBOR to continue from the start of the buffer and resume writing the output.
Such a feature would really work well with CoAP block-wise transfers, as the data could be effectively "streamed" instead of having to buffer the lot.
I tried looking around for whether there was a flag I could specify on the decoder, but couldn't see any flags in the documentation.
Regards,
Stuart Longland
- Lenguaje dominante
- C
- Estrellas
- 641
- Forks
- 222
- Merge medio
- 21 h 33 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de intel/tinycbor
-
CborValidateTagUse rejects valid tag 1 (epoch) with a floating-point value, and restricts tags 21-23 too muchPosiblemente ocupada @thiagomacieira la tomó hace 13 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
CBOR validation not worksAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
Todos los issues de intel/tinycbor
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
FujiNetWIFI/fujinet-lib#186 ·
Los mantenedores suelen responder en 1 día
-
VIEW_TYPE set for computer playersPosiblemente ocupada @Loobinex la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 Menos de una hora Aptitud para principiantes 78/100
brunodev85/winlator-app#90 ·