X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/fc92f9969c1fcc2f952f0bd6d09a309a9b3ce02f..1621158c622e8dbe49deaacf88ea3f5b843b54ac:/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h?ds=sidebyside diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h index 059f76dc5..d412647eb 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h @@ -101,8 +101,7 @@ * * \return Boolean true if the buffer has been captured by the application for device-to-host transmissions, false otherwise */ - #define TCP_APP_HAVE_CAPTURED_BUFFER(Buffer) (!(Buffer->Ready) && Buffer->InUse && \ - (Buffer->Direction == TCP_PACKETDIR_OUT)) + #define TCP_APP_HAVE_CAPTURED_BUFFER(Buffer) (!(Buffer->Ready) && Buffer->InUse && (Buffer->Direction == TCP_PACKETDIR_OUT)) /** Application macro: Indicates if the application can lock the buffer for multiple continued device-to-host transmissions. * @@ -115,7 +114,7 @@ /** Application macro: Captures the application buffer, locking it for device-to-host transmissions only. This should be * performed when the application needs to transmit several packets worth of data in succession with no interruptions from the host. * - * \note The application must check that the buffer can be locked first using TCP_APP_CAN_CAPTURE_BUFFER(). + * \pre The application must check that the buffer can be locked first using TCP_APP_CAN_CAPTURE_BUFFER(). * * \param[in] Buffer Application buffer to lock */ @@ -229,18 +228,31 @@ } TCP_Header_t; /* Function Prototypes: */ - void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* RNDISInterfaceInfo); + void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo); void TCP_Init(void); - bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*)); - uint8_t TCP_GetPortState(uint16_t Port); - bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort, uint8_t State); - uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort); - TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort); - int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void* TCPHeaderOutStart); + bool TCP_SetPortState(const uint16_t Port, + const uint8_t State, + void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*)); + uint8_t TCP_GetPortState(const uint16_t Port); + bool TCP_SetConnectionState(const uint16_t Port, + const IP_Address_t RemoteAddress, + const uint16_t RemotePort, + const uint8_t State); + uint8_t TCP_GetConnectionState(const uint16_t Port, + const IP_Address_t RemoteAddress, + const uint16_t RemotePort); + TCP_ConnectionInfo_t* TCP_GetConnectionInfo(const uint16_t Port, + const IP_Address_t RemoteAddress, + const uint16_t RemotePort); + int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, + void* TCPHeaderInStart, + void* TCPHeaderOutStart); #if defined(INCLUDE_FROM_TCP_C) - static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, IP_Address_t SourceAddress, - IP_Address_t DestinationAddress, uint16_t TCPOutSize); + static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, + const IP_Address_t SourceAddress, + const IP_Address_t DestinationAddress, + uint16_t TCPOutSize); #endif #endif