
#include "finger_para.h"

const finger_param_ts fingerParams[DEF_PRG_NUM] = {
//      项目号    包长     传感器数量 压力数量  三维力数量   自电容接近数量   互电容接近数量   原始值字节长度     三维力数据类型    包含状态码   标定力数量      项目名称
    {PN_TS_F_A_OLD, 62,         8,          7,      1,              1,              0,              4,                  2,              0,          22,         "通用手指"},
    {PN_TS_F_A,     62,         8,          7,      1,              1,              0,              4,                  2,              0,          22,         "通用手指New"},
    {PN_TS_E_A,     78,         16,         13,     2,              2,              1,              3,                  4,              1,          22,         "两指-大包"},
    {PN_TS_F_A2,    60,         14,         13,     1,              1,              0,              3,                  4,              1,          22,         "通用点阵"},
    {PN_TS_F_B,     36,         6,          5,      1,              1,              0,              3,                  4,              1,          22,         "通用Thumb"},
    {PN_TS_F_C,     66,        12,          9,      2,              2,              1,              3,                  4,              1,          22,         "通用middle"},
    {PN_TS_F_L,     36,         6,          5,      1,              1,              0,              3,                  4,              1,          22,         "通用little"},
    {PN_TS_F_B2,    36,         6,          5,      1,              1,              0,              3,                  4,              1,          22,         "通用四指"}
};


bool findFingerPara(uint8_t pn, finger_param_ts *pPara)
{
    for(uint8_t i=0; i<DEF_PRG_NUM; i++)
    {
        if(pn == fingerParams[i].pn)
        {
            memcpy((void *)pPara, (void *)&fingerParams[i], sizeof(finger_param_ts));

            return true;
        }
    }

    memcpy((void *)pPara, (void *)&fingerParams[0], sizeof(finger_param_ts));

    return false;
}

