Add "const" to pData

Add "const" to pData to prevent compile errors in some situations
This commit is contained in:
Dmitry
2015-12-25 01:14:22 +03:00
parent c73fb02107
commit 2d1d4f219e
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -696,7 +696,7 @@ INT8U MCP_CAN::init_Filt(INT8U num, INT8U ext, INT32U ulData)
** Function name: setMsg
** Descriptions: set can message, such as dlc, id, dta[] and so on
*********************************************************************************************************/
INT8U MCP_CAN::setMsg(INT32U id, INT8U ext, INT8U len, INT8U rtr, INT8U *pData)
INT8U MCP_CAN::setMsg(INT32U id, INT8U ext, INT8U len, INT8U rtr, const INT8U *pData)
{
int i = 0;
m_nExtFlg = ext;
@@ -715,7 +715,7 @@ INT8U MCP_CAN::setMsg(INT32U id, INT8U ext, INT8U len, INT8U rtr, INT8U *pData)
** Function name: setMsg
** Descriptions: set can message, such as dlc, id, dta[] and so on
*********************************************************************************************************/
INT8U MCP_CAN::setMsg(INT32U id, INT8U ext, INT8U len, INT8U *pData)
INT8U MCP_CAN::setMsg(INT32U id, INT8U ext, INT8U len, const INT8U *pData)
{
int i = 0;
m_nExtFlg = ext;
@@ -784,7 +784,7 @@ INT8U MCP_CAN::sendMsg()
** Function name: sendMsgBuf
** Descriptions: send buf
*********************************************************************************************************/
INT8U MCP_CAN::sendMsgBuf(INT32U id, INT8U ext, INT8U rtr, INT8U len, INT8U *buf)
INT8U MCP_CAN::sendMsgBuf(INT32U id, INT8U ext, INT8U rtr, INT8U len, const INT8U *buf)
{
setMsg(id, ext, len, rtr, buf);
return sendMsg();
@@ -794,7 +794,7 @@ INT8U MCP_CAN::sendMsgBuf(INT32U id, INT8U ext, INT8U rtr, INT8U len, INT8U *buf
** Function name: sendMsgBuf
** Descriptions: send buf
*********************************************************************************************************/
INT8U MCP_CAN::sendMsgBuf(INT32U id, INT8U ext, INT8U len, INT8U *buf)
INT8U MCP_CAN::sendMsgBuf(INT32U id, INT8U ext, INT8U len, const INT8U *buf)
{
setMsg(id, ext, len, buf);
return sendMsg();
+4 -4
View File
@@ -89,8 +89,8 @@ private:
* can operator function
*/
INT8U setMsg(INT32U id, INT8U ext, INT8U len, INT8U rtr, INT8U *pData); /* set message */
INT8U setMsg(INT32U id, INT8U ext, INT8U len, INT8U *pData); /* set message */
INT8U setMsg(INT32U id, INT8U ext, INT8U len, INT8U rtr, const INT8U *pData); /* set message */
INT8U setMsg(INT32U id, INT8U ext, INT8U len, const INT8U *pData); /* set message */
INT8U clearMsg(); /* clear all message to zero */
INT8U readMsg(); /* read message */
INT8U sendMsg(); /* send message */
@@ -100,8 +100,8 @@ public:
INT8U begin(INT8U speedset); /* init can */
INT8U init_Mask(INT8U num, INT8U ext, INT32U ulData); /* init Masks */
INT8U init_Filt(INT8U num, INT8U ext, INT32U ulData); /* init filters */
INT8U sendMsgBuf(INT32U id, INT8U ext, INT8U rtr, INT8U len, INT8U *buf); /* send buf */
INT8U sendMsgBuf(INT32U id, INT8U ext, INT8U len, INT8U *buf); /* send buf */
INT8U sendMsgBuf(INT32U id, INT8U ext, INT8U rtr, INT8U len, const INT8U *buf); /* send buf */
INT8U sendMsgBuf(INT32U id, INT8U ext, INT8U len, const INT8U *buf); /* send buf */
INT8U readMsgBuf(INT8U *len, INT8U *buf); /* read buf */
INT8U readMsgBufID(INT32U *ID, INT8U *len, INT8U *buf); /* read buf with object ID */
INT8U checkReceive(void); /* if something received */