SIM-115: update simulator to use latest E2SM KPM version 3
[sim/e2-interface.git] / e2sim / asn1c / BOOLEAN_jer.c
1 /*
2  * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
3  * All rights reserved.
4  * Redistribution and modifications are permitted subject to BSD license.
5  */
6 #include <asn_internal.h>
7 #include <asn_codecs_prim.h>
8 #include <BOOLEAN.h>
9 #include <errno.h>
10
11 asn_enc_rval_t
12 BOOLEAN_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
13                    int ilevel, enum jer_encoder_flags_e flags,
14                    asn_app_consume_bytes_f *cb, void *app_key) {
15     const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
16     asn_enc_rval_t er = {0, 0, 0};
17
18     (void)ilevel;
19     (void)flags;
20
21     if(!st) ASN__ENCODE_FAILED;
22
23     if(*st) {
24         ASN__CALLBACK("true", 4);
25     } else {
26         ASN__CALLBACK("false", 5);
27     }
28
29     ASN__ENCODED_OK(er);
30 cb_failed:
31     ASN__ENCODE_FAILED;
32 }