mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 14:29:39 +00:00
PPP, PPPoS: Use const void*
instead of u8_t*
in pppos_output_cb_fn()
There is no good reason why this function should take a non-const pointer, as the output callback should never modify what lwIP gives it. While changing that also switch to a more generic `void*` instead of "byte".
This commit is contained in:
parent
7f91a71eca
commit
b2d1fc119d
@ -258,11 +258,11 @@ pppLinkStatusCallback(ppp_pcb *pcb, int errCode, void *ctx)
|
|||||||
|
|
||||||
#if PPPOS_SUPPORT
|
#if PPPOS_SUPPORT
|
||||||
static u32_t
|
static u32_t
|
||||||
ppp_output_cb(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx)
|
ppp_output_cb(ppp_pcb *pcb, const void *data, u32_t len, void *ctx)
|
||||||
{
|
{
|
||||||
LWIP_UNUSED_ARG(pcb);
|
LWIP_UNUSED_ARG(pcb);
|
||||||
LWIP_UNUSED_ARG(ctx);
|
LWIP_UNUSED_ARG(ctx);
|
||||||
return sio_write(ppp_sio, data, len);
|
return sio_write(ppp_sio, (u8_t*)data, len);
|
||||||
}
|
}
|
||||||
#endif /* PPPOS_SUPPORT */
|
#endif /* PPPOS_SUPPORT */
|
||||||
#endif /* USE_PPP */
|
#endif /* USE_PPP */
|
||||||
|
@ -156,11 +156,11 @@ ppp_link_status_cb(ppp_pcb *pcb, int err_code, void *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static u32_t
|
static u32_t
|
||||||
ppp_output_cb(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx)
|
ppp_output_cb(ppp_pcb *pcb, const void *data, u32_t len, void *ctx)
|
||||||
{
|
{
|
||||||
LWIP_UNUSED_ARG(pcb);
|
LWIP_UNUSED_ARG(pcb);
|
||||||
LWIP_UNUSED_ARG(ctx);
|
LWIP_UNUSED_ARG(ctx);
|
||||||
return sio_write(ppp_sio, data, len);
|
return sio_write(ppp_sio, (u8_t*)data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LWIP_NETIF_STATUS_CALLBACK
|
#if LWIP_NETIF_STATUS_CALLBACK
|
||||||
|
@ -195,7 +195,7 @@ static void status_cb(ppp_pcb *pcb, int err_code, void *ctx) {
|
|||||||
*
|
*
|
||||||
* Return value: len if write succeed
|
* Return value: len if write succeed
|
||||||
*/
|
*/
|
||||||
static u32_t output_cb(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx) {
|
static u32_t output_cb(ppp_pcb *pcb, const void *data, u32_t len, void *ctx) {
|
||||||
return uart_write(UART, data, len);
|
return uart_write(UART, data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* PPPoS serial output callback function prototype */
|
/* PPPoS serial output callback function prototype */
|
||||||
typedef u32_t (*pppos_output_cb_fn)(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx);
|
typedef u32_t (*pppos_output_cb_fn)(ppp_pcb *pcb, const void *data, u32_t len, void *ctx);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Extended asyncmap - allows any character to be escaped.
|
* Extended asyncmap - allows any character to be escaped.
|
||||||
|
Loading…
Reference in New Issue
Block a user