mcb_test.c 571 B

12345678910111213141516171819202122232425262728
  1. // +build ignore
  2. #include "mcu_ctrl_board.h"
  3. char *RTU_JsonMsgProcCb(const char *request)
  4. {
  5. char *response = (char *)malloc(MAX_LINE_CHARS);
  6. if (!response) return NULL;
  7. snprintf(response, MAX_LINE_CHARS, "{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32601,\"message\":\"Method not found\"},\"id\":1}");
  8. return response;
  9. }
  10. int main(int argc,char *argv[])
  11. {
  12. int ret = MCBComInit();
  13. if(ret < 0)
  14. {
  15. sw_log_error("an error occurred while calling the MCBComInit() function(%d)!!", ret);
  16. goto end_p;
  17. }
  18. getchar();
  19. end_p:
  20. MCBComExit();
  21. return 0;
  22. }