diff --git a/gex/gex_bulk.c b/gex/gex_bulk.c index 7a6f3cc..06e5e8a 100644 --- a/gex/gex_bulk.c +++ b/gex/gex_bulk.c @@ -121,7 +121,7 @@ bool GEX_BulkWrite(GexUnit *unit, GexBulk *bulk) if (max_size < bulk->len) { fprintf(stderr, "Write not possible, not enough space.\n"); // Inform GEX we're not going to do it - GEX_SendEx(unit, MSG_BULK_ABORT, NULL, 0, resp0.session, true); + GEX_SendEx(unit, MSG_BULK_ABORT, NULL, 0, resp0.session, true, true); return false; } @@ -145,7 +145,7 @@ bool GEX_BulkWrite(GexUnit *unit, GexBulk *bulk) } // Conclude the transfer - GEX_SendEx(unit, MSG_BULK_END, NULL, 0, resp0.session, true); + GEX_SendEx(unit, MSG_BULK_END, NULL, 0, resp0.session, true, true); return true; } diff --git a/gex/gex_unit.c b/gex/gex_unit.c index 497fb73..27a22de 100644 --- a/gex/gex_unit.c +++ b/gex/gex_unit.c @@ -86,12 +86,12 @@ void GEX_Send(GexUnit *unit, uint8_t cmd, const uint8_t *payload, uint32_t len) /** Send with no listener, don't wait for response */ void GEX_SendEx(GexUnit *unit, uint8_t cmd, const uint8_t *payload, uint32_t len, - GexSession session, bool is_reply) + GexSession session, bool is_reply, bool raw_pld) { assert(unit != NULL); assert(unit->gex != NULL); - GEX_LL_Query(unit, cmd, payload, len, session, is_reply, NULL, NULL, false); + GEX_LL_Query(unit, cmd, payload, len, session, is_reply, NULL, NULL, raw_pld); } /** listener for the synchronous query functionality */ diff --git a/gex/gex_unit.h b/gex/gex_unit.h index 02e5c56..004eb47 100644 --- a/gex/gex_unit.h +++ b/gex/gex_unit.h @@ -65,6 +65,7 @@ GexMsg GEX_QueryEx(GexUnit *unit, uint8_t cmd, void GEX_SendEx(GexUnit *unit, uint8_t cmd, const uint8_t *payload, uint32_t len, - GexSession session, bool is_reply); + GexSession session, bool is_reply, + bool raw_pld); #endif //GEX_CLIENT_GEX_UNIT_H diff --git a/main.c b/main.c index 6472c17..6e82df9 100644 --- a/main.c +++ b/main.c @@ -99,7 +99,7 @@ int main(void) #endif #if 1 - // Read the communist manifesto via bulk transfer + // Load settings to a buffer as INI uint8_t inifile[10000]; br = (GexBulk){ .buffer = inifile, @@ -111,6 +111,11 @@ int main(void) uint32_t actuallyRead = GEX_BulkRead(GEX_SystemUnit(gex), &br); fprintf(stderr, "Read %d bytes of INI:\n", actuallyRead); fprintf(stderr, "%.*s", actuallyRead, inifile); + + // And send it back... + br.len = actuallyRead; + br.req_cmd = MSG_INI_WRITE; + GEX_BulkWrite(GEX_SystemUnit(gex), &br); #endif #if 0