Timed mk_saem
This commit is contained in:
parent
4247a050a1
commit
bf51bd0eae
8
src/sa.c
8
src/sa.c
|
|
@ -203,9 +203,12 @@ void *sa_service(void *fc) {
|
||||||
|
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
|
||||||
|
int sleep_ms = 100;
|
||||||
|
int mk_saem_n_sleep = 0;
|
||||||
|
|
||||||
while (!facilities->exit) {
|
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);
|
rv = mk_saem(facilities, bdr->data.buf, (uint32_t *) &bdr->data.size);
|
||||||
if (!rv) {
|
if (!rv) {
|
||||||
asn_enc_rval_t enc = oer_encode_to_buffer(&asn_DEF_TransportDataRequest, NULL, tdr, tdr_oer+1, 1023);
|
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);
|
pthread_cond_signal(&facilities->tx_queue->trigger);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mk_saem_n_sleep = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_lock(&bulletin->lock);
|
pthread_mutex_lock(&bulletin->lock);
|
||||||
|
|
@ -256,7 +260,7 @@ void *sa_service(void *fc) {
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&bulletin->lock);
|
pthread_mutex_unlock(&bulletin->lock);
|
||||||
|
|
||||||
usleep(100000);
|
usleep(sleep_ms*1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASN_STRUCT_FREE(asn_DEF_TransportDataRequest, tdr);
|
ASN_STRUCT_FREE(asn_DEF_TransportDataRequest, tdr);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue