2011-05-13 76 views
1

这是我对LED和蜂鸣器通知摩托罗拉ES400符号通知

Symbol.Generic.Device device = new Symbol.Generic.Device(); 
Symbol.Notification.Beeper sound = new Symbol.Notification.Beeper(device); 
sound.Volume = 5; 
sound.Frequency = 300; 

Symbol.Notification.LED led = new Symbol.Notification.LED(device); 
led.CycleCount = 5; 
led.OffDuration = 2000; 
led.OnDuration = 3000; 

,但我看不到任何通知代码=/

回答

1

摩托罗拉通知API是一个有点奇怪 - 你没有创建自己的设备对象,而是从Device.AvailableDevices检索。喜欢的东西:

var beeperDevice = Symbol.Notification.Device.AvailableDevices 
      .FirstOrDefault(d => d.ObjectType == NotifyType.BEEPER);  
var beeper = new Symbol.Notification.Beeper(beeperDevice); 

上面的代码没有测试,但看起来superfically正确的 - 你需要确认你的beeperDevice已经发现(这是一个结构没有找到这样的时候不会为null)。