MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / doModMessagePostToMachine

Function doModMessagePostToMachine

modules/base/worker/modWorker.c:535–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533}
534
535void doModMessagePostToMachine(xsMachine *the, xsMachine *targetThe, uint8_t *message, modMessageDeliver callback, void *refcon)
536{
537 char *error;
538 int result;
539
540 if (message) {
541 result = modMessagePostToMachine(targetThe, (uint8_t *)&message, sizeof(message), callback, refcon);
542 if (!result)
543 return;
544 c_free(message);
545 }
546 else {
547 result = modMessagePostToMachine(targetThe, NULL, 0, callback, refcon);
548 if (!result)
549 return;
550 }
551
552 if (-1 == result)
553 error = "no memory";
554 else if (-2 == result)
555 error = "timeout";
556 else
557 error = "unknown";
558
559 xsUnknownError(error);
560}
561
562#ifdef INC_FREERTOS_H
563

Callers 4

workerConstructorFunction · 0.85
xs_worker_postfromworkerFunction · 0.85
xs_worker_closeFunction · 0.85

Calls 1

modMessagePostToMachineFunction · 0.50

Tested by

no test coverage detected