Is protocol type limited to 8 bit in socket creation?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is protocol type limited to 8 bit in socket creation?

730 Views
zekelandon
Contributor III

Hi There,

I am Zeke, working on sample projects to understand the capability of NXP MIMXRT1064 board and FreeRTOS. In this process, I was creating a raw socket with custom protocol say 0xFFFF (more than 8 bits). In case of raw socket, netconn_new_with_proto_and_callback() method typecasts the protocol to uint8_t hence I am losing 8 bits in my protocol type thus resulting in different one than I intended.

pastedImage_12.png

Protocol intended: 0xFFFF

Protocol created:  0xFF (lost 8 bits in typecasting)

Is this a limitation? Or there exists a way to handle protocol type of more than 8 bits in raw socket?

Regards,

Zeke

Labels (1)
0 Kudos
3 Replies

672 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi zekelandon ,

 From the netconn code structure, this is fixed to 8 bit.

pastedImage_1.png

pastedImage_2.png

So, you need to use 8 bit mode.

Wish it helps you!

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

0 Kudos

672 Views
zekelandon
Contributor III

Hi Kerry,

In that case, it is limitation of the system right?

Regards,

Zeke

0 Kudos

672 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi zekelandon,

  Today, I help you to check with our expert.

   He told me that the 8 bit proto is determined by the LWIP, the LWIP stack just can support the 8 bit proto. Your 16 bit may from the full function of the TCP/IP protocal.

   We suggest you use the 8bit instead of the 16 bit.

Wish it helps you!

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

0 Kudos