void ReportDescParserBase::PrintButtonPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);
    E_Notify(PSTR("Btn"), 0x80);
    PrintHex<uint16_t > (usage, 0x80);
    E_Notify(PSTR("\r\n"), 0x80);
    //USB_HOST_SERIAL.print(usage, HEX);
}
void ReportDescParserBase::PrintGenericDeviceControlsPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x1f && usage < 0x27)
        E_Notify((char*)pgm_read_pointer(&genDevCtrlTitles[usage - 0x20]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
void ReportDescParserBase::PrintOrdinalPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);
    E_Notify(PSTR("Inst"), 0x80);
    // Sorry, HEX for now...
    PrintHex<uint16_t > (usage, 0x80);
    E_Notify(PSTR("\r\n"), 0x80);
    //USB_HOST_SERIAL.print(usage, DEC);
}
void ReportDescParserBase::PrintLEDPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x00 && usage < 0x4e)
        E_Notify((char*)pgm_read_pointer(&ledTitles[usage - 1]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
void ReportDescParserBase::PrintGameControlsPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x00 && usage < 0x04)
        E_Notify((char*)pgm_read_pointer(&gameTitles0[usage - 1]), 0x80);
    else if (usage > 0x1f && usage < 0x3a)
        E_Notify((char*)pgm_read_pointer(&gameTitles1[usage - 0x20]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
Esempio n. 6
0
void PrintZoom()
{
    uint16_t    val = 0;
    E_Notify(PSTR("Zoom:"),0x80);
    
    if (Ps.GetDevicePropValue(PS_DPC_Zoom, (uint16_t&)val) == PTP_RC_OK)
        PrintHex<uint16_t>(val,0x80); 
        
    E_Notify(PSTR("\r\n"),0x80);
}
void ReportDescParserBase::PrintUsagePage(uint16_t page) {
    E_Notify(pstrSpace, 0x80);

    if (page > 0x00 && page < 0x11)
        E_Notify((char*)pgm_read_pointer(&usagePageTitles0[page - 1]), 0x80);
    else if (page > 0x7f && page < 0x84)
        E_Notify(pstrUsagePageMonitor, 0x80);
    else if (page > 0x83 && page < 0x8c)
        E_Notify(pstrUsagePagePower, 0x80);
    else if (page > 0x8b && page < 0x92)
        E_Notify((char*)pgm_read_pointer(&usagePageTitles1[page - 0x8c]), 0x80);
    else if (page > 0xfeff && page <= 0xffff)
        E_Notify(pstrUsagePageVendorDefined, 0x80);
    else
        switch (page) {
        case 0x14:
            E_Notify(pstrUsagePageAlphaNumericDisplay, 0x80);
            break;
        case 0x40:
            E_Notify(pstrUsagePageMedicalInstruments, 0x80);
            break;
        default:
            E_Notify(pstrUsagePageUndefined, 0x80);
        }
}
void ReportDescParserBase::PrintSportsControlsPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x00 && usage < 0x05)
        E_Notify((char*)pgm_read_pointer(&sportsCtrlTitles0[usage - 1]), 0x80);
    else if (usage > 0x2f && usage < 0x3a)
        E_Notify((char*)pgm_read_pointer(&sportsCtrlTitles1[usage - 0x30]), 0x80);
    else if (usage > 0x4f && usage < 0x64)
        E_Notify((char*)pgm_read_pointer(&sportsCtrlTitles2[usage - 0x50]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
void ReportDescParserBase::PrintSimulationControlsPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x00 && usage < 0x0d)
        E_Notify((char*)pgm_read_pointer(&simuTitles0[usage - 1]), 0x80);
    else if (usage > 0x1f && usage < 0x26)
        E_Notify((char*)pgm_read_pointer(&simuTitles1[usage - 0x20]), 0x80);
    else if (usage > 0xaf && usage < 0xd1)
        E_Notify((char*)pgm_read_pointer(&simuTitles2[usage - 0xb0]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
void ReportDescParserBase::PrintAlphanumDisplayPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x00 && usage < 0x03)
        E_Notify((char*)pgm_read_pointer(&aplphanumTitles0[usage - 1]), 0x80);
    else if (usage > 0x1f && usage < 0x4e)
        E_Notify((char*)pgm_read_pointer(&aplphanumTitles1[usage - 0x1f]), 0x80);
    else if (usage > 0x7f && usage < 0x96)
        E_Notify((char*)pgm_read_pointer(&digitTitles2[usage - 0x80]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
void ReportDescParserBase::PrintDigitizerPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x00 && usage < 0x0e)
        E_Notify((char*)pgm_read_pointer(&digitTitles0[usage - 1]), 0x80);
    else if (usage > 0x1f && usage < 0x23)
        E_Notify((char*)pgm_read_pointer(&digitTitles1[usage - 0x1f]), 0x80);
    else if (usage > 0x2f && usage < 0x47)
        E_Notify((char*)pgm_read_pointer(&digitTitles2[usage - 0x2f]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
Esempio n. 12
0
QState PSConsole::Inactive(PSConsole *me, QEvent const *e) 
{
    switch (e->sig) 
    {
        case Q_ENTRY_SIG: 
            E_Notify(PSTR("Inactive\r\n"),0x80);
            return Q_HANDLED();
        case TICK_SIG: 
            return Q_TRAN(&PSConsole::Active);
    }
    return Q_SUPER(QHsm::top);
}
void ReportDescParserBase::PrintMedicalInstrumentPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage == 1)
        E_Notify(pstrUsageMedicalUltrasound, 0x80);
    else if (usage > 0x1f && usage < 0x28)
        E_Notify((char*)pgm_read_pointer(&medInstrTitles0[usage - 0x1f]), 0x80);
    else if (usage > 0x3f && usage < 0x45)
        E_Notify((char*)pgm_read_pointer(&medInstrTitles1[usage - 0x40]), 0x80);
    else if (usage > 0x5f && usage < 0x62)
        E_Notify((char*)pgm_read_pointer(&medInstrTitles2[usage - 0x60]), 0x80);
    else if (usage == 0x70)
        E_Notify(pstrUsageDepthGainCompensation, 0x80);
    else if (usage > 0x7f && usage < 0x8a)
        E_Notify((char*)pgm_read_pointer(&medInstrTitles3[usage - 0x80]), 0x80);
    else if (usage > 0x9f && usage < 0xa2)
        E_Notify((char*)pgm_read_pointer(&medInstrTitles4[usage - 0xa0]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
void ReportDescParserBase::PrintTelephonyPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x00 && usage < 0x08)
        E_Notify((char*)pgm_read_pointer(&telTitles0[usage - 1]), 0x80);
    else if (usage > 0x1f && usage < 0x32)
        E_Notify((char*)pgm_read_pointer(&telTitles1[usage - 0x1f]), 0x80);
    else if (usage > 0x4f && usage < 0x54)
        E_Notify((char*)pgm_read_pointer(&telTitles2[usage - 0x4f]), 0x80);
    else if (usage > 0x6f && usage < 0x75)
        E_Notify((char*)pgm_read_pointer(&telTitles3[usage - 0x6f]), 0x80);
    else if (usage > 0x8f && usage < 0x9f)
        E_Notify((char*)pgm_read_pointer(&telTitles4[usage - 0x8f]), 0x80);
    else if (usage > 0xaf && usage < 0xc0)
        E_Notify((char*)pgm_read_pointer(&telTitles5[usage - 0xaf]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
void ReportDescParserBase::PrintGenericDesktopPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x00 && usage < 0x0a)
        E_Notify((char*)pgm_read_pointer(&genDesktopTitles0[usage - 1]), 0x80);
    else if (usage > 0x2f && usage < 0x49)
        E_Notify((char*)pgm_read_pointer(&genDesktopTitles1[usage - 0x30]), 0x80);
    else if (usage > 0x7f && usage < 0x94)
        E_Notify((char*)pgm_read_pointer(&genDesktopTitles2[usage - 0x80]), 0x80);
    else if (usage > 0x9f && usage < 0xa9)
        E_Notify((char*)pgm_read_pointer(&genDesktopTitles3[usage - 0xa0]), 0x80);
    else if (usage > 0xaf && usage < 0xb8)
        E_Notify((char*)pgm_read_pointer(&genDesktopTitles4[usage - 0xb0]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
Esempio n. 16
0
void PrintCamOutput()
{
    E_Notify(PSTR("CamOutput:"),0x80);
    PrintValueTitle<uint8_t, VT_CAMOUTPUT, VT_CAMOUTPUT_COUNT, VT_CAMOUTPUT_TEXT_LEN>((PTP*)&Ps, PS_DPC_CameraOutput, CamOutputTitles);
    E_Notify(PSTR("\r\n"),0x80);
}
Esempio n. 17
0
void PrintExpCompensation()
{
    E_Notify(PSTR("ExpComp:"),0x80);
    PrintValueTitle<uint8_t, VT_EXPCOMP, VT_EXPCOMP_COUNT, VT_EXPCOMP_TEXT_LEN>((PTP*)&Ps, PS_DPC_ExpCompensation, ExpCompTitles);
    E_Notify(PSTR("\r\n"),0x80);
}
Esempio n. 18
0
void PrintIso()
{
    E_Notify(PSTR("ISO:"),0x80);
    PrintValueTitle<uint16_t, VT_ISO, VT_ISO_COUNT, VT_ISO_TEXT_LEN>((PTP*)&Ps, PS_DPC_ISOSpeed, IsoTitles);
    E_Notify(PSTR("\r\n"),0x80);
}
Esempio n. 19
0
void PrintWB()
{
    E_Notify(PSTR("WB:"),0x80);
    PrintValueTitle<uint8_t, VT_WB, VT_WB_COUNT, VT_WB_TEXT_LEN>((PTP*)&Ps, PS_DPC_WhiteBalance, WbTitles);
    E_Notify(PSTR("\r\n"),0x80);
}
Esempio n. 20
0
void PrintShutterSpeed()
{
    E_Notify(PSTR("T:"),0x80);
    PrintValueTitle<uint16_t, VT_SHSPEED, VT_SHSPEED_COUNT, VT_SHSPEED_TEXT_LEN>((PTP*)&Ps, PS_DPC_ShutterSpeed, ShutterSpeedTitles);
    E_Notify(PSTR("\r\n"),0x80);
}
Esempio n. 21
0
void PrintAperture()
{
    E_Notify(PSTR("F:"),0x80);
    PrintValueTitle<uint16_t, VT_APERTURE, VT_APT_COUNT, VT_APT_TEXT_LEN>((PTP*)&Ps, PS_DPC_Aperture, ApertureTitles);
    E_Notify(PSTR("\r\n"),0x80);
}
void ReportDescParserBase::PrintConsumerPageUsage(uint16_t usage) {
    E_Notify(pstrSpace, 0x80);

    if (usage > 0x00 && usage < 0x07)
        E_Notify((char*)pgm_read_pointer(&consTitles0[usage - 1]), 0x80);
    else if (usage > 0x1f && usage < 0x23)
        E_Notify((char*)pgm_read_pointer(&consTitles1[usage - 0x1f]), 0x80);
    else if (usage > 0x2f && usage < 0x37)
        E_Notify((char*)pgm_read_pointer(&consTitles2[usage - 0x2f]), 0x80);
    else if (usage > 0x3f && usage < 0x49)
        E_Notify((char*)pgm_read_pointer(&consTitles3[usage - 0x3f]), 0x80);
    else if (usage > 0x5f && usage < 0x67)
        E_Notify((char*)pgm_read_pointer(&consTitles4[usage - 0x5f]), 0x80);
    else if (usage > 0x7f && usage < 0xa5)
        E_Notify((char*)pgm_read_pointer(&consTitles5[usage - 0x7f]), 0x80);
    else if (usage > 0xaf && usage < 0xcf)
        E_Notify((char*)pgm_read_pointer(&consTitles6[usage - 0xaf]), 0x80);
    else if (usage > 0xdf && usage < 0xeb)
        E_Notify((char*)pgm_read_pointer(&consTitles7[usage - 0xdf]), 0x80);
    else if (usage > 0xef && usage < 0xf6)
        E_Notify((char*)pgm_read_pointer(&consTitles8[usage - 0xef]), 0x80);
    else if (usage > 0xff && usage < 0x10e)
        E_Notify((char*)pgm_read_pointer(&consTitles9[usage - 0xff]), 0x80);
    else if (usage > 0x14f && usage < 0x156)
        E_Notify((char*)pgm_read_pointer(&consTitlesA[usage - 0x14f]), 0x80);
    else if (usage > 0x15f && usage < 0x16b)
        E_Notify((char*)pgm_read_pointer(&consTitlesB[usage - 0x15f]), 0x80);
    else if (usage > 0x16f && usage < 0x175)
        E_Notify((char*)pgm_read_pointer(&consTitlesC[usage - 0x16f]), 0x80);
    else if (usage > 0x17f && usage < 0x1c8)
        E_Notify((char*)pgm_read_pointer(&consTitlesD[usage - 0x17f]), 0x80);
    else if (usage > 0x1ff && usage < 0x29d)
        E_Notify((char*)pgm_read_pointer(&consTitlesE[usage - 0x1ff]), 0x80);
    else
        E_Notify(pstrUsagePageUndefined, 0x80);
}
Esempio n. 23
0
void EOSConsole::ShowParams()
{
    E_Notify(PSTR("\r\nMode:"),0x80);
    E_Notify((char*)FindTitle<VT_MODE, VT_MODE_TEXT_LEN>(VT_MODE_COUNT, ModeTitles, dpMode),0x80);
    E_Notify(PSTR("\r\nF:"),0x80);
    E_Notify((char*)FindTitle<VT_APERTURE, VT_APT_TEXT_LEN>(VT_APT_COUNT, ApertureTitles, dpAperture),0x80);
    E_Notify(PSTR("\r\nT:"),0x80);
    E_Notify((char*)FindTitle<VT_SHSPEED, VT_SHSPEED_TEXT_LEN>(VT_SHSPEED_COUNT, ShutterSpeedTitles, dpShutterSpeed),0x80);
    E_Notify(PSTR("\r\nWB:"),0x80);
    E_Notify((char*)FindTitle<VT_WB, VT_WB_TEXT_LEN>(VT_WB_COUNT, WbTitles, dpWb),0x80);
    E_Notify(PSTR("\r\nPict Style:"),0x80);
    E_Notify((char*)FindTitle<VT_PSTYLE, VT_PSTYLE_TEXT_LEN>(VT_PSTYLE_COUNT, PStyleTitles, dpPStyle),0x80);
    E_Notify(PSTR("\r\nISO:"),0x80);
    E_Notify((char*)FindTitle<VT_ISO, VT_ISO_TEXT_LEN>(VT_ISO_COUNT, IsoTitles, dpIso),0x80);
    E_Notify(PSTR("\r\nExp Comp:"),0x80);
    E_Notify((char*)FindTitle<VT_EXPCOMP, VT_EXPCOMP_TEXT_LEN>(VT_EXPCOMP_COUNT, ExpCompTitles, dpExpComp),0x80);
    E_Notify(PSTR("\r\n"),0x80);
}
Esempio n. 24
0
void PSEventParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint32_t &offset)
{
	uint16_t	cntdn	= (uint16_t)len;
	uint8_t		*p		= (uint8_t*)pbuf;

	switch (nStage)
	{
	case 0:
		p		+= 12;
		cntdn	-= 12;

		if (!cntdn)
			return;
		nStage	++;

	case 1:
		//E_Notify(PSTR("\r\nEvent Block Size:\t"),0x80);
		theBuffer.valueSize = 4;
		valueParser.Initialize(&theBuffer);
		nStage ++;
	case 2:
		if (!valueParser.Parse(&p, &cntdn))
			return;

		//PrintHex<uint32_t>(*((uint32_t*)theBuffer.pValue));
		nStage ++;
	case 3:
		//E_Notify(PSTR("\r\nNumber of Fields:\t"),0x80);
		theBuffer.valueSize = 2;
		valueParser.Initialize(&theBuffer);
		nStage ++;
	case 4:
		if (!valueParser.Parse(&p, &cntdn))
			return;

		//PrintHex<uint16_t>(*((uint16_t*)theBuffer.pValue));
		nStage ++;
	case 5:
		//E_Notify(PSTR("\r\nEvent Code:\t"),0x80);
		theBuffer.valueSize = 2;
		valueParser.Initialize(&theBuffer);
		nStage ++;
	case 6:
		if (!valueParser.Parse(&p, &cntdn))
			return;

        eventCode = *((uint16_t*)theBuffer.pValue);
		//PrintHex<uint16_t>(*((uint16_t*)theBuffer.pValue));
		nStage ++;
	case 7:
		//E_Notify(PSTR("\r\nTransaction ID:\t"),0x80);
		theBuffer.valueSize = 4;
		valueParser.Initialize(&theBuffer);
		nStage ++;
	case 8:
		if (!valueParser.Parse(&p, &cntdn))
			return;

		//PrintHex<uint32_t>(*((uint32_t*)theBuffer.pValue));
		nStage ++;
    case 9:
        if (eventCode == PTP_EC_ObjectAdded)
			E_Notify(PSTR("\r\nObject Added:\t\t"),0x80);

		theBuffer.valueSize = 4;
		valueParser.Initialize(&theBuffer);
		nStage ++;
    case 10:
        if (eventCode == PTP_EC_ObjectAdded)
        {
			if (!valueParser.Parse(&p, &cntdn))
				return;

			objHandle = *((uint32_t*)theBuffer.pValue);
			PrintHex<uint32_t>(*((uint32_t*)theBuffer.pValue),0x80);
			E_Notify(PSTR("\r\n"),0x80);
        }
		if (eventCode == PTP_EC_CaptureComplete)
			E_Notify(PSTR("\r\nCapture complete.\r\n"),0x80);
		nStage ++;
    case 11:
		nStage = 0;
	}
}
void ReportDescParserBase::PrintValue(uint8_t *p, uint8_t len) {
    E_Notify(PSTR("("), 0x80);
    for (; len; p++, len--)
        PrintHex<uint8_t > (*p, 0x80);
    E_Notify(PSTR(")"), 0x80);
}
void ReportDescParserBase::PrintItemTitle(uint8_t prefix) {
    switch (prefix & (TYPE_MASK | TAG_MASK)) {
    case (TYPE_GLOBAL | TAG_GLOBAL_PUSH):
        E_Notify(PSTR("\r\nPush"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_POP):
        E_Notify(PSTR("\r\nPop"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE):
        E_Notify(PSTR("\r\nUsage Page"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMIN):
        E_Notify(PSTR("\r\nLogical Min"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMAX):
        E_Notify(PSTR("\r\nLogical Max"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMIN):
        E_Notify(PSTR("\r\nPhysical Min"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMAX):
        E_Notify(PSTR("\r\nPhysical Max"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_UNITEXP):
        E_Notify(PSTR("\r\nUnit Exp"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_UNIT):
        E_Notify(PSTR("\r\nUnit"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE):
        E_Notify(PSTR("\r\nReport Size"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT):
        E_Notify(PSTR("\r\nReport Count"), 0x80);
        break;
    case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID):
        E_Notify(PSTR("\r\nReport Id"), 0x80);
        break;
    case (TYPE_LOCAL | TAG_LOCAL_USAGE):
        E_Notify(PSTR("\r\nUsage"), 0x80);
        break;
    case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
        E_Notify(PSTR("\r\nUsage Min"), 0x80);
        break;
    case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX):
        E_Notify(PSTR("\r\nUsage Max"), 0x80);
        break;
    case (TYPE_MAIN | TAG_MAIN_COLLECTION):
        E_Notify(PSTR("\r\nCollection"), 0x80);
        break;
    case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION):
        E_Notify(PSTR("\r\nEnd Collection"), 0x80);
        break;
    case (TYPE_MAIN | TAG_MAIN_INPUT):
        E_Notify(PSTR("\r\nInput"), 0x80);
        break;
    case (TYPE_MAIN | TAG_MAIN_OUTPUT):
        E_Notify(PSTR("\r\nOutput"), 0x80);
        break;
    case (TYPE_MAIN | TAG_MAIN_FEATURE):
        E_Notify(PSTR("\r\nFeature"), 0x80);
        break;
    } // switch (**pp & (TYPE_MASK | TAG_MASK))
}
uint8_t ReportDescParserBase::ParseItem(uint8_t **pp, uint16_t *pcntdn) {
    //uint8_t	ret = enErrorSuccess;

    switch (itemParseState) {
    case 0:
        if (**pp == HID_LONG_ITEM_PREFIX)
            USBTRACE("\r\nLONG\r\n");
        else {
            uint8_t size = ((**pp) & DATA_SIZE_MASK);

            itemPrefix = (**pp);
            itemSize = 1 + ((size == DATA_SIZE_4) ? 4 : size);

            PrintItemTitle(itemPrefix);
        }
        (*pp)++;
        (*pcntdn)--;
        itemSize--;
        itemParseState = 1;

        if (!itemSize)
            break;

        if (!pcntdn)
            return enErrorIncomplete;
    case 1:
        //USBTRACE2("\r\niSz:",itemSize);

        theBuffer.valueSize = itemSize;
        valParser.Initialize(&theBuffer);
        itemParseState = 2;
    case 2:
        if (!valParser.Parse(pp, pcntdn))
            return enErrorIncomplete;
        itemParseState = 3;
    case 3:
    {
        uint8_t data = *((uint8_t*)varBuffer);

        switch (itemPrefix & (TYPE_MASK | TAG_MASK)) {
        case (TYPE_LOCAL | TAG_LOCAL_USAGE):
            if (pfUsage) {
                if (theBuffer.valueSize > 1)
                    pfUsage(*((uint16_t*)varBuffer));
                else
                    pfUsage(data);
            }
            break;
        case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE):
            rptSize = data;
            PrintByteValue(data);
            break;
        case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT):
            rptCount = data;
            PrintByteValue(data);
            break;
        case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMIN):
        case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMAX):
        case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMIN):
        case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMAX):
        case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID):
        case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
        case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX):
        case (TYPE_GLOBAL | TAG_GLOBAL_UNITEXP):
        case (TYPE_GLOBAL | TAG_GLOBAL_UNIT):
            PrintValue(varBuffer, theBuffer.valueSize);
            break;
        case (TYPE_GLOBAL | TAG_GLOBAL_PUSH):
        case (TYPE_GLOBAL | TAG_GLOBAL_POP):
            break;
        case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE):
            SetUsagePage(data);
            PrintUsagePage(data);
            PrintByteValue(data);
            break;
        case (TYPE_MAIN | TAG_MAIN_COLLECTION):
        case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION):
            switch (data) {
            case 0x00:
                E_Notify(PSTR(" Physical"), 0x80);
                break;
            case 0x01:
                E_Notify(PSTR(" Application"), 0x80);
                break;
            case 0x02:
                E_Notify(PSTR(" Logical"), 0x80);
                break;
            case 0x03:
                E_Notify(PSTR(" Report"), 0x80);
                break;
            case 0x04:
                E_Notify(PSTR(" Named Array"), 0x80);
                break;
            case 0x05:
                E_Notify(PSTR(" Usage Switch"), 0x80);
                break;
            case 0x06:
                E_Notify(PSTR(" Usage Modifier"), 0x80);
                break;
            default:
                E_Notify(PSTR(" Vendor Defined("), 0x80);
                PrintHex<uint8_t > (data, 0x80);
                E_Notify(PSTR(")"), 0x80);
            }
            break;
        case (TYPE_MAIN | TAG_MAIN_INPUT):
        case (TYPE_MAIN | TAG_MAIN_OUTPUT):
        case (TYPE_MAIN | TAG_MAIN_FEATURE):
            totalSize += (uint16_t)rptSize * (uint16_t)rptCount;
            rptSize = 0;
            rptCount = 0;
            E_Notify(PSTR("("), 0x80);
            PrintBin<uint8_t > (data, 0x80);
            E_Notify(PSTR(")"), 0x80);
            break;
        } // switch (**pp & (TYPE_MASK | TAG_MASK))
    }
    } // switch (itemParseState)
    itemParseState = 0;
    return enErrorSuccess;
}
void ReportDescParserBase::PrintByteValue(uint8_t data) {
    E_Notify(PSTR("("), 0x80);
    PrintHex<uint8_t > (data, 0x80);
    E_Notify(PSTR(")"), 0x80);
}
Esempio n. 29
0
void PrintMode()
{
    E_Notify(PSTR("Mode:"),0x80);
    PrintValueTitle<uint8_t, VT_MODE, VT_MODE_COUNT, VT_MODE_TEXT_LEN>((PTP*)&Ps, PS_DPC_ShootingMode, ModeTitles);
    E_Notify(PSTR("\r\n"),0x80);
}