1 /* 2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HISIGNALLING_H 17 #define HISIGNALLING_H 18 19 #define HISIGNALLING_MSG_HEADER_LEN (1) 20 #define NUM7 7 21 #define SEND_BUFF_LEN 22 22 #define HISGNALLING_MSG_FRAME_HEADER_LEN (2) 23 #define HISIGNALLING_MSG_HEADER_TAIL_LEN (3) 24 #define HISGNALLING_FREE_TASK_TIME (10) 25 #define HISIGNALLING_MSG_MOTOR_ENGINE_LEN (11) 26 #define HISIGNALLING_MSG_ONE_FRAME_LEN (16) 27 #define HISIGNALLING_MSG_BUFF_LEN (512) 28 29 /** 30 * @brief: use this hisignalling Transmission protocol frame format 31 * 32 * @param frameHeader: Transmission protocol frame header 33 * 34 * @param hisignallingMsgBuf: Transmission protocol frame buffer 35 * 36 * @param hisigallingMsgLen: Transmission protocol frame buffer len 37 * 38 * @param endOfFrame: Transmission protocol frame tail 39 * 40 * @param hisignallingCrc32Check: Transmission protocol crc32 check 41 * 42 * */ 43 typedef struct { 44 unsigned char frameHeader[HISGNALLING_MSG_FRAME_HEADER_LEN]; 45 unsigned char hisignallingMsgBuf[HISIGNALLING_MSG_BUFF_LEN]; 46 unsigned int hisigallingMsgLen; 47 unsigned char endOfFrame; 48 unsigned int hisignallingCrc32Check; 49 }HisignallingProtocalType; 50 51 /** 52 * @brief: use this hisignalling return type 53 * 54 * @param HISIGNALLING_RET_VAL_CORRECT: return type is correct 55 * 56 * @param HISIGNALLING_RET_VAL_ERROR: return type is error 57 * 58 * @param HISIGNALLING_RET_VAL_ERROR: return type is unknown type 59 * */ 60 typedef enum { 61 HISIGNALLING_RET_VAL_CORRECT = 0, 62 HISIGNALLING_RET_VAL_ERROR, 63 HISGNALLING_RET_VAL_MAX 64 }HisignallingErrorType; 65 66 #endif