mirror of
https://github.com/bettse/seader.git
synced 2026-03-29 05:49:56 +00:00
Add UHF transport ASN.1 definitions
This commit is contained in:
70
lib/asn1/I2CCommand.c
Normal file
70
lib/asn1/I2CCommand.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "Seader"
|
||||
* found in "seader.asn1"
|
||||
* `asn1c -S ./lib/asn1_skeletons -D ./lib/asn1 -no-gen-example -no-gen-OER -no-gen-PER -pdu=all`
|
||||
*/
|
||||
|
||||
#include "I2CCommand.h"
|
||||
|
||||
asn_TYPE_member_t asn_MBR_I2CCommand_1[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct I2CCommand, header),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_OCTET_STRING,
|
||||
0,
|
||||
{ 0, 0, 0 },
|
||||
0, 0, /* No default value */
|
||||
"header"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct I2CCommand, busAddress),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_NativeInteger,
|
||||
0,
|
||||
{ 0, 0, 0 },
|
||||
0, 0, /* No default value */
|
||||
"busAddress"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct I2CCommand, uhfModuleCommand),
|
||||
(ASN_TAG_CLASS_CONTEXT | (22 << 2)),
|
||||
+1, /* EXPLICIT tag at current level */
|
||||
&asn_DEF_UHFModuleCommand,
|
||||
0,
|
||||
{ 0, 0, 0 },
|
||||
0, 0, /* No default value */
|
||||
"uhfModuleCommand"
|
||||
},
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_I2CCommand_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_I2CCommand_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* header */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* busAddress */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (22 << 2)), 2, 0, 0 } /* uhfModuleCommand */
|
||||
};
|
||||
asn_SEQUENCE_specifics_t asn_SPC_I2CCommand_specs_1 = {
|
||||
sizeof(struct I2CCommand),
|
||||
offsetof(struct I2CCommand, _asn_ctx),
|
||||
asn_MAP_I2CCommand_tag2el_1,
|
||||
3, /* Count of tags in the map */
|
||||
0, 0, 0, /* Optional elements (not needed) */
|
||||
-1, /* First extension addition */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_I2CCommand = {
|
||||
"I2CCommand",
|
||||
"I2CCommand",
|
||||
&asn_OP_SEQUENCE,
|
||||
asn_DEF_I2CCommand_tags_1,
|
||||
sizeof(asn_DEF_I2CCommand_tags_1)
|
||||
/sizeof(asn_DEF_I2CCommand_tags_1[0]), /* 1 */
|
||||
asn_DEF_I2CCommand_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_I2CCommand_tags_1)
|
||||
/sizeof(asn_DEF_I2CCommand_tags_1[0]), /* 1 */
|
||||
{ 0, 0, SEQUENCE_constraint },
|
||||
asn_MBR_I2CCommand_1,
|
||||
3, /* Elements count */
|
||||
&asn_SPC_I2CCommand_specs_1 /* Additional specs */
|
||||
};
|
||||
|
||||
44
lib/asn1/I2CCommand.h
Normal file
44
lib/asn1/I2CCommand.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "Seader"
|
||||
* found in "seader.asn1"
|
||||
* `asn1c -S ./lib/asn1_skeletons -D ./lib/asn1 -no-gen-example -no-gen-OER -no-gen-PER -pdu=all`
|
||||
*/
|
||||
|
||||
#ifndef _I2CCommand_H_
|
||||
#define _I2CCommand_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <OCTET_STRING.h>
|
||||
#include <NativeInteger.h>
|
||||
#include "UHFModuleCommand.h"
|
||||
#include <constr_SEQUENCE.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* I2CCommand */
|
||||
typedef struct I2CCommand {
|
||||
OCTET_STRING_t header;
|
||||
long busAddress;
|
||||
UHFModuleCommand_t uhfModuleCommand;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} I2CCommand_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_I2CCommand;
|
||||
extern asn_SEQUENCE_specifics_t asn_SPC_I2CCommand_specs_1;
|
||||
extern asn_TYPE_member_t asn_MBR_I2CCommand_1[3];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _I2CCommand_H_ */
|
||||
#include <asn_internal.h>
|
||||
@@ -26,6 +26,15 @@ static asn_TYPE_member_t asn_MBR_Payload_1[] = {
|
||||
0, 0, /* No default value */
|
||||
"nfcCommand"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct Payload, choice.i2cCommand),
|
||||
(ASN_TAG_CLASS_CONTEXT | (10 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_I2CCommand,
|
||||
0,
|
||||
{ 0, 0, 0 },
|
||||
0, 0, /* No default value */
|
||||
"i2cCommand"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct Payload, choice.response),
|
||||
(ASN_TAG_CLASS_CONTEXT | (29 << 2)),
|
||||
+1, /* EXPLICIT tag at current level */
|
||||
@@ -48,8 +57,9 @@ static asn_TYPE_member_t asn_MBR_Payload_1[] = {
|
||||
static const asn_TYPE_tag2member_t asn_MAP_Payload_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* samCommand */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* nfcCommand */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (29 << 2)), 2, 0, 0 }, /* response */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (30 << 2)), 3, 0, 0 } /* errorResponse */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 2, 0, 0 }, /* i2cCommand */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (29 << 2)), 3, 0, 0 }, /* response */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (30 << 2)), 4, 0, 0 } /* errorResponse */
|
||||
};
|
||||
static asn_CHOICE_specifics_t asn_SPC_Payload_specs_1 = {
|
||||
sizeof(struct Payload),
|
||||
@@ -57,7 +67,7 @@ static asn_CHOICE_specifics_t asn_SPC_Payload_specs_1 = {
|
||||
offsetof(struct Payload, present),
|
||||
sizeof(((struct Payload *)0)->present),
|
||||
asn_MAP_Payload_tag2el_1,
|
||||
4, /* Count of tags in the map */
|
||||
5, /* Count of tags in the map */
|
||||
0, 0,
|
||||
-1 /* Extensions start */
|
||||
};
|
||||
@@ -71,7 +81,7 @@ asn_TYPE_descriptor_t asn_DEF_Payload = {
|
||||
0, /* No tags (count) */
|
||||
{ 0, 0, CHOICE_constraint },
|
||||
asn_MBR_Payload_1,
|
||||
4, /* Elements count */
|
||||
5, /* Elements count */
|
||||
&asn_SPC_Payload_specs_1 /* Additional specs */
|
||||
};
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
/* Including external dependencies */
|
||||
#include "SamCommand.h"
|
||||
#include "NFCCommand.h"
|
||||
#include "I2CCommand.h"
|
||||
#include "Response.h"
|
||||
#include "ErrorResponse.h"
|
||||
#include <constr_CHOICE.h>
|
||||
@@ -27,6 +28,7 @@ typedef enum Payload_PR {
|
||||
Payload_PR_NOTHING, /* No components present */
|
||||
Payload_PR_samCommand,
|
||||
Payload_PR_nfcCommand,
|
||||
Payload_PR_i2cCommand,
|
||||
Payload_PR_response,
|
||||
Payload_PR_errorResponse
|
||||
} Payload_PR;
|
||||
@@ -37,6 +39,7 @@ typedef struct Payload {
|
||||
union Payload_u {
|
||||
SamCommand_t samCommand;
|
||||
NFCCommand_t nfcCommand;
|
||||
I2CCommand_t i2cCommand;
|
||||
Response_t response;
|
||||
ErrorResponse_t errorResponse;
|
||||
} choice;
|
||||
|
||||
@@ -26,6 +26,15 @@ asn_TYPE_member_t asn_MBR_Response_1[] = {
|
||||
0, 0, /* No default value */
|
||||
"samResponse"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct Response, choice.uhfModuleResponse),
|
||||
(ASN_TAG_CLASS_CONTEXT | (23 << 2)),
|
||||
+1, /* EXPLICIT tag at current level */
|
||||
&asn_DEF_UHFModuleResponse,
|
||||
0,
|
||||
{ 0, 0, 0 },
|
||||
0, 0, /* No default value */
|
||||
"uhfModuleResponse"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct Response, choice.samResponse2),
|
||||
(ASN_TAG_CLASS_CONTEXT | (19 << 2)),
|
||||
+1, /* EXPLICIT tag at current level */
|
||||
@@ -39,7 +48,8 @@ asn_TYPE_member_t asn_MBR_Response_1[] = {
|
||||
static const asn_TYPE_tag2member_t asn_MAP_Response_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nfcResponse */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 1, 0, 0 }, /* samResponse */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (19 << 2)), 2, 0, 0 } /* samResponse2 */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (19 << 2)), 3, 0, 0 }, /* samResponse2 */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (23 << 2)), 2, 0, 0 } /* uhfModuleResponse */
|
||||
};
|
||||
asn_CHOICE_specifics_t asn_SPC_Response_specs_1 = {
|
||||
sizeof(struct Response),
|
||||
@@ -47,7 +57,7 @@ asn_CHOICE_specifics_t asn_SPC_Response_specs_1 = {
|
||||
offsetof(struct Response, present),
|
||||
sizeof(((struct Response *)0)->present),
|
||||
asn_MAP_Response_tag2el_1,
|
||||
3, /* Count of tags in the map */
|
||||
4, /* Count of tags in the map */
|
||||
0, 0,
|
||||
-1 /* Extensions start */
|
||||
};
|
||||
@@ -61,7 +71,7 @@ asn_TYPE_descriptor_t asn_DEF_Response = {
|
||||
0, /* No tags (count) */
|
||||
{ 0, 0, CHOICE_constraint },
|
||||
asn_MBR_Response_1,
|
||||
3, /* Elements count */
|
||||
4, /* Elements count */
|
||||
&asn_SPC_Response_specs_1 /* Additional specs */
|
||||
};
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
/* Including external dependencies */
|
||||
#include "NFCResponse.h"
|
||||
#include "SamResponse.h"
|
||||
#include "UHFModuleResponse.h"
|
||||
#include "SamResponse2.h"
|
||||
#include <constr_CHOICE.h>
|
||||
|
||||
@@ -26,6 +27,7 @@ typedef enum Response_PR {
|
||||
Response_PR_NOTHING, /* No components present */
|
||||
Response_PR_nfcResponse,
|
||||
Response_PR_samResponse,
|
||||
Response_PR_uhfModuleResponse,
|
||||
Response_PR_samResponse2
|
||||
} Response_PR;
|
||||
|
||||
@@ -35,6 +37,7 @@ typedef struct Response {
|
||||
union Response_u {
|
||||
NFCResponse_t nfcResponse;
|
||||
SamResponse_t samResponse;
|
||||
UHFModuleResponse_t uhfModuleResponse;
|
||||
SamResponse2_t samResponse2;
|
||||
} choice;
|
||||
|
||||
@@ -45,7 +48,7 @@ typedef struct Response {
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_Response;
|
||||
extern asn_CHOICE_specifics_t asn_SPC_Response_specs_1;
|
||||
extern asn_TYPE_member_t asn_MBR_Response_1[3];
|
||||
extern asn_TYPE_member_t asn_MBR_Response_1[4];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ static const asn_INTEGER_enum_map_t asn_MAP_SoMediaEdgeType_value2enum_1[] = {
|
||||
{ 2, 6, "mifare" },
|
||||
{ 3, 8, "picoPass" },
|
||||
{ 6, 10, "mifarePlus" },
|
||||
{ 7, 4, "seos" }
|
||||
{ 7, 4, "seos" },
|
||||
{ 10, 3, "uhf" }
|
||||
};
|
||||
static const unsigned int asn_MAP_SoMediaEdgeType_enum2value_1[] = {
|
||||
1, /* desfire(1) */
|
||||
@@ -25,12 +26,13 @@ static const unsigned int asn_MAP_SoMediaEdgeType_enum2value_1[] = {
|
||||
4, /* mifarePlus(6) */
|
||||
3, /* picoPass(3) */
|
||||
5, /* seos(7) */
|
||||
6, /* uhf(10) */
|
||||
0 /* unknown(0) */
|
||||
};
|
||||
const asn_INTEGER_specifics_t asn_SPC_SoMediaEdgeType_specs_1 = {
|
||||
asn_MAP_SoMediaEdgeType_value2enum_1, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_SoMediaEdgeType_enum2value_1, /* N => "tag"; sorted by N */
|
||||
6, /* Number of elements in the maps */
|
||||
7, /* Number of elements in the maps */
|
||||
0, /* Enumeration is not extensible */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
|
||||
@@ -25,7 +25,8 @@ typedef enum SoMediaEdgeType {
|
||||
SoMediaEdgeType_mifare = 2,
|
||||
SoMediaEdgeType_picoPass = 3,
|
||||
SoMediaEdgeType_mifarePlus = 6,
|
||||
SoMediaEdgeType_seos = 7
|
||||
SoMediaEdgeType_seos = 7,
|
||||
SoMediaEdgeType_uhf = 10
|
||||
} e_SoMediaEdgeType;
|
||||
|
||||
/* SoMediaEdgeType */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "UHFModuleCommand.h"
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_UHFModuleCommand_1[] = {
|
||||
asn_TYPE_member_t asn_MBR_UHFModuleCommand_1[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct UHFModuleCommand, choice.uhfModuleCommandGetVersion),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
@@ -91,7 +91,7 @@ static const asn_TYPE_tag2member_t asn_MAP_UHFModuleCommand_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* uhfModuleCommandSetAccessPassword */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 } /* uhfModuleCommandGetPrivateData */
|
||||
};
|
||||
static asn_CHOICE_specifics_t asn_SPC_UHFModuleCommand_specs_1 = {
|
||||
asn_CHOICE_specifics_t asn_SPC_UHFModuleCommand_specs_1 = {
|
||||
sizeof(struct UHFModuleCommand),
|
||||
offsetof(struct UHFModuleCommand, _asn_ctx),
|
||||
offsetof(struct UHFModuleCommand, present),
|
||||
|
||||
@@ -59,6 +59,8 @@ typedef struct UHFModuleCommand {
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_UHFModuleCommand;
|
||||
extern asn_CHOICE_specifics_t asn_SPC_UHFModuleCommand_specs_1;
|
||||
extern asn_TYPE_member_t asn_MBR_UHFModuleCommand_1[8];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "UHFModuleResponse.h"
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_UHFModuleResponse_1[] = {
|
||||
asn_TYPE_member_t asn_MBR_UHFModuleResponse_1[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct UHFModuleResponse, choice.uhfModuleResponseVersion),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
@@ -91,7 +91,7 @@ static const asn_TYPE_tag2member_t asn_MAP_UHFModuleResponse_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* uhfModuleResponseSetAccessPassword */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 } /* uhfModuleResponseGetPrivateData */
|
||||
};
|
||||
static asn_CHOICE_specifics_t asn_SPC_UHFModuleResponse_specs_1 = {
|
||||
asn_CHOICE_specifics_t asn_SPC_UHFModuleResponse_specs_1 = {
|
||||
sizeof(struct UHFModuleResponse),
|
||||
offsetof(struct UHFModuleResponse, _asn_ctx),
|
||||
offsetof(struct UHFModuleResponse, present),
|
||||
|
||||
@@ -59,6 +59,8 @@ typedef struct UHFModuleResponse {
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_UHFModuleResponse;
|
||||
extern asn_CHOICE_specifics_t asn_SPC_UHFModuleResponse_specs_1;
|
||||
extern asn_TYPE_member_t asn_MBR_UHFModuleResponse_1[8];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
11
seader.asn1
11
seader.asn1
@@ -12,10 +12,17 @@ NoArguments ::= NULL
|
||||
Payload ::= CHOICE {
|
||||
samCommand [0] SamCommand, --aka SioAPI
|
||||
nfcCommand [1] NFCCommand,
|
||||
i2cCommand [10] I2CCommand,
|
||||
response [29] Response,
|
||||
errorResponse [30] ErrorResponse
|
||||
}
|
||||
|
||||
I2CCommand ::= SEQUENCE {
|
||||
header [0] OCTET STRING,
|
||||
busAddress [1] INTEGER,
|
||||
uhfModuleCommand [22] UHFModuleCommand
|
||||
}
|
||||
|
||||
ErrorResponse ::= SEQUENCE {
|
||||
errorCode [0] INTEGER,
|
||||
data [1] OCTET STRING
|
||||
@@ -48,6 +55,7 @@ SamResponse2 ::= CHOICE {
|
||||
Response ::= CHOICE {
|
||||
nfcResponse [0] NFCResponse,
|
||||
samResponse [10] SamResponse,
|
||||
uhfModuleResponse [23] UHFModuleResponse,
|
||||
samResponse2 [19] SamResponse2
|
||||
}
|
||||
|
||||
@@ -97,7 +105,8 @@ SoMediaEdgeType ::= ENUMERATED {
|
||||
mifare (2),
|
||||
picoPass (3),
|
||||
mifarePlus (6),
|
||||
seos (7)
|
||||
seos (7),
|
||||
uhf (10)
|
||||
}
|
||||
|
||||
SamVerionDetails ::= SEQUENCE {
|
||||
|
||||
Reference in New Issue
Block a user