2011-05-13 71 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)。