aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c')
-rw-r--r--demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c
index 21cc9d28c..f456ee62a 100644
--- a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c
+++ b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c
@@ -68,6 +68,7 @@ typedef struct stub_op {
static objects_fifo_t ops_fifo;
static msg_t ops_msgs[STUB_MAX_OPS];
static struct stub_op ops[STUB_MAX_OPS] = {0};
+static bool tsSkelIsReady = false;
/*===========================================================================*/
/* Module local functions. */
@@ -149,6 +150,9 @@ THD_FUNCTION(TsStubsService, tsstate) {
}
switch (skrp->req) {
+ case SKEL_REQ_READY:
+ tsSkelIsReady = true;
+ break;
case SKEL_REQ_GETOP:
/* The nsec skeleton calls us to get a new op ready to be executed.*/
@@ -245,6 +249,12 @@ THD_FUNCTION(TsStubsService, tsstate) {
}
}
+void tsWaitStubSkelReady(void) {
+ while (!tsSkelIsReady) {
+ chThdSleepMilliseconds(100);
+ }
+}
+
int socket(int domain, int type, int protocol) {
stub_op_t *op = getNewOp();
op->op_code = STUB_OP_SOCKET;