Timed mk_saem

This commit is contained in:
emanuel 2021-07-23 16:57:21 +01:00
parent 4247a050a1
commit bf51bd0eae
1 changed files with 6 additions and 2 deletions

View File

@ -203,9 +203,12 @@ void *sa_service(void *fc) {
int rv = 0;
int sleep_ms = 100;
int mk_saem_n_sleep = 0;
while (!facilities->exit) {
if (bulletin->to_provide_len) {
if (bulletin->to_provide_len && sleep_ms*mk_saem_n_sleep >= 1000) {
rv = mk_saem(facilities, bdr->data.buf, (uint32_t *) &bdr->data.size);
if (!rv) {
asn_enc_rval_t enc = oer_encode_to_buffer(&asn_DEF_TransportDataRequest, NULL, tdr, tdr_oer+1, 1023);
@ -217,6 +220,7 @@ void *sa_service(void *fc) {
pthread_cond_signal(&facilities->tx_queue->trigger);
}
}
mk_saem_n_sleep = 0;
}
pthread_mutex_lock(&bulletin->lock);
@ -256,7 +260,7 @@ void *sa_service(void *fc) {
}
pthread_mutex_unlock(&bulletin->lock);
usleep(100000);
usleep(sleep_ms*1000);
}
ASN_STRUCT_FREE(asn_DEF_TransportDataRequest, tdr);