问题
i'm working on MC67 with windows mobile 6.0 and Motorola symbol.dll.
I need to light the red light in the device. i looked at the Motorola example and they don't show a way to do it, which makes me think there is no way to do it with symbol.dll.
is there a different way to do it? or do you know a general way to light the red led in the MC67? i'm talking on the red light because i already succeeded lighting all the others using Motorola Symbol.dll
回答1:
There is a class LED in Symbol.Notification namespace (EMDK .Net by Motorola).
I'm not tried but i think it helps you to solve your problem.
回答2:
All LEDs on WM are normally accessible using the NLED API. The problem is that you have to find the ID for the red LED yourself:
First get the number of LEDs:
NLED_COUNT_INFO cInfo;
memset(&cInfo, 0, sizeof(cInfo));
NLedGetDeviceInfo(NLED_COUNT_INFO_ID, &cInfo);
Then check each LED ID using LED ON/OFF (some support BLINK):
/*
struct NLED_SETTINGS_INFO
{
UINT LedNum; // @FIELD LED number, 0 is first LED
INT OffOnBlink; // @FIELD 0 == off, 1 == on, 2 == blink
LONG TotalCycleTime; // @FIELD total cycle time of a blink in microseconds
LONG OnTime; // @FIELD on time of a cycle in microseconds
LONG OffTime; // @FIELD off time of a cycle in microseconds
INT MetaCycleOn; // @FIELD number of on blink cycles
INT MetaCycleOff; // @FIELD number of off blink cycles
};
*/
NLED_SETTINGS_INFO settings;
memset(&settings, 0, sizeof(settings));
settings.LedNum= id;
/* 0 Off
1 On
2 Blink */
settings.OffOnBlink= onoff;
settings.TotalCycleTime=1000;
settings.OnTime = 500;
settings.OffTime=500;
settings.MetaCycleOn=5;
settings.MetaCycleOff=5;
if (!NLedSetDevice(NLED_SETTINGS_INFO_ID, &settings))
{
DEBUGMSG(true,(L"NLedSetDevice(NLED_SETTINGS_INFO_ID) failed"));
}
else
{
DEBUGMSG(true,(L"NLedSetDevice(NLED_SETTINGS_INFO_ID) success"));
}
PhoneGap has a CS interface for the above C API: https://github.com/hemisphire/phonegap-winmo/blob/master/NotificationCommand.cs
The above works on all WM devices not only Motorola. It is a more general approach than using OEM SDK which will not work on other devices.
来源:https://stackoverflow.com/questions/17993056/how-to-activate-the-red-light-in-mc67