Skip to content

Commit 212c1ca

Browse files
authored
Merge pull request COVESA#27 from boschglobal/refactore/udp
Rename Avtp_UDP_t to Avtp_Udp_t
2 parents 2da7035 + ac1676d commit 212c1ca

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

examples/acf-can/acf-can-listener.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int new_packet(int sk_fd, int can_socket) {
178178
uint8_t pdu[MAX_PDU_SIZE];
179179
uint8_t* cf_pdu;
180180
uint8_t* acf_pdu;
181-
Avtp_UDP_t *udp_pdu;
181+
Avtp_Udp_t *udp_pdu;
182182
char stdout_string[1000] = "\0";
183183
struct can_frame frame;
184184
uint64_t eff;
@@ -191,8 +191,8 @@ static int new_packet(int sk_fd, int can_socket) {
191191
}
192192

193193
if (use_udp) {
194-
udp_pdu = (Avtp_UDP_t *) pdu;
195-
Avtp_UDP_GetField(udp_pdu, AVTP_UDP_FIELD_ENCAPSULATION_SEQ_NO, &udp_seq_num);
194+
udp_pdu = (Avtp_Udp_t *) pdu;
195+
Avtp_Udp_GetField(udp_pdu, AVTP_UDP_FIELD_ENCAPSULATION_SEQ_NO, &udp_seq_num);
196196
cf_pdu = pdu + AVTP_UDP_HEADER_LEN;
197197
proc_bytes += AVTP_UDP_HEADER_LEN;
198198
} else {

examples/acf-can/acf-can-talker.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ int main(int argc, char *argv[])
321321
pdu_length = 0;
322322

323323
if (use_udp) {
324-
Avtp_UDP_t *udp_pdu = (Avtp_UDP_t *) pdu;
325-
Avtp_UDP_SetField(udp_pdu, AVTP_UDP_FIELD_ENCAPSULATION_SEQ_NO,
324+
Avtp_Udp_t *udp_pdu = (Avtp_Udp_t *) pdu;
325+
Avtp_Udp_SetField(udp_pdu, AVTP_UDP_FIELD_ENCAPSULATION_SEQ_NO,
326326
seq_num);
327-
cf_pdu = &pdu[sizeof(Avtp_UDP_t)];
327+
cf_pdu = &pdu[sizeof(Avtp_Udp_t)];
328328
} else {
329329
cf_pdu = pdu;
330330
}

include/avtp/Udp.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
typedef struct {
4545
uint8_t header[AVTP_UDP_HEADER_LEN];
4646
uint8_t payload[0];
47-
} Avtp_UDP_t;
47+
} Avtp_Udp_t;
4848

4949
typedef enum {
5050

@@ -53,14 +53,14 @@ typedef enum {
5353

5454
/* Count number of fields for bound checks */
5555
AVTP_UDP_FIELD_MAX
56-
} Avtp_UDPFields_t;
56+
} Avtp_UdpFields_t;
5757

5858
/**
5959
* Initializes a UDP PDU as specified in the IEEE 1722-2016 Specification.
6060
*
6161
* @param pdu Pointer to the first bit of an IEEE 1722 UDP PDU.
6262
*/
63-
int Avtp_UDP_Init(Avtp_UDP_t* pdu);
63+
int Avtp_Udp_Init(Avtp_Udp_t* pdu);
6464

6565
/**
6666
* Returns the value of an an AVTP UDP field as specified in the IEEE 1722 Specification.
@@ -71,7 +71,7 @@ int Avtp_UDP_Init(Avtp_UDP_t* pdu);
7171
* @returns This function returns 0 if the data field was successfully read from
7272
* the 1722 AVTP PDU.
7373
*/
74-
int Avtp_UDP_GetField(Avtp_UDP_t* pdu, Avtp_UDPFields_t field, uint64_t* value);
74+
int Avtp_Udp_GetField(Avtp_Udp_t* pdu, Avtp_UdpFields_t field, uint64_t* value);
7575

7676
/**
7777
* Sets the value of an an AVTP UDP field as specified in the IEEE 1722 Specification.
@@ -82,5 +82,5 @@ int Avtp_UDP_GetField(Avtp_UDP_t* pdu, Avtp_UDPFields_t field, uint64_t* value);
8282
* @returns This function returns 0 if the data field was successfully set in
8383
* the 1722 AVTP PDU.
8484
*/
85-
int Avtp_UDP_SetField(Avtp_UDP_t* pdu, Avtp_UDPFields_t field, uint64_t value);
85+
int Avtp_Udp_SetField(Avtp_Udp_t* pdu, Avtp_UdpFields_t field, uint64_t value);
8686

src/avtp/Udp.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,32 @@
3636
/**
3737
* This table maps all IEEE 1722 UDP-specific header fields to a descriptor.
3838
*/
39-
static const Avtp_FieldDescriptor_t Avtp_UDPFieldDesc[AVTP_UDP_FIELD_MAX] = {
39+
static const Avtp_FieldDescriptor_t Avtp_UdpFieldDesc[AVTP_UDP_FIELD_MAX] = {
4040

4141
[AVTP_UDP_FIELD_ENCAPSULATION_SEQ_NO] = { .quadlet = 0, .offset = 0, .bits = 32 },
4242
};
4343

44-
int Avtp_UDP_Init(Avtp_UDP_t* pdu) {
44+
int Avtp_Udp_Init(Avtp_Udp_t* pdu) {
4545

4646
int res = 0;
4747

4848
if (!pdu)
4949
return -EINVAL;
5050

51-
memset(pdu, 0, sizeof(Avtp_UDP_t));
51+
memset(pdu, 0, sizeof(Avtp_Udp_t));
5252

53-
res = Avtp_SetField(Avtp_UDPFieldDesc, AVTP_UDP_FIELD_MAX, (uint8_t*) pdu,
53+
res = Avtp_SetField(Avtp_UdpFieldDesc, AVTP_UDP_FIELD_MAX, (uint8_t*) pdu,
5454
AVTP_UDP_FIELD_ENCAPSULATION_SEQ_NO, 0);
5555

5656
return res;
5757
}
5858

59-
int Avtp_UDP_GetField(Avtp_UDP_t* pdu,
60-
Avtp_UDPFields_t field, uint64_t* value) {
61-
return Avtp_GetField(Avtp_UDPFieldDesc, AVTP_UDP_FIELD_MAX, (uint8_t*) pdu, (uint8_t) field, value);
59+
int Avtp_Udp_GetField(Avtp_Udp_t* pdu,
60+
Avtp_UdpFields_t field, uint64_t* value) {
61+
return Avtp_GetField(Avtp_UdpFieldDesc, AVTP_UDP_FIELD_MAX, (uint8_t*) pdu, (uint8_t) field, value);
6262
}
6363

64-
int Avtp_UDP_SetField(Avtp_UDP_t* pdu,
65-
Avtp_UDPFields_t field, uint64_t value) {
66-
return Avtp_SetField(Avtp_UDPFieldDesc, AVTP_UDP_FIELD_MAX, (uint8_t*) pdu, (uint8_t) field, value);
64+
int Avtp_Udp_SetField(Avtp_Udp_t* pdu,
65+
Avtp_UdpFields_t field, uint64_t value) {
66+
return Avtp_SetField(Avtp_UdpFieldDesc, AVTP_UDP_FIELD_MAX, (uint8_t*) pdu, (uint8_t) field, value);
6767
}

0 commit comments

Comments
 (0)