Controlling Scanner Indicator LED Bar Programmatically

C Chase Carlile 3 years 7 months ago
127 2 0

I'm programming an app for the MC92N0 handheld, and I have a business requirement to use the indicator bar to alert the user that something has happened on the server that needs attention.  A red flashing light would indicate an urgent issue.  An amber light would be a warning, etc.  Is this possible? 
 
From what I've found so far, those lights are used for charging status and scanner status (not scanning, successful decode).
 
I'm currently using the Xamarin component, but I could possibly create a new binding if it's something that's in an excluded namespace.

Please Register or Login to post a reply

2 Replies

E Efkan YILMAZ

You can use the standard Android notification APIs.  Take a look here. 
android - How to have LED Light Notification? - Stack Overflow

I tried this code, and it does work,  but as mentioned in the post,  it will only light up the LEDs if the screen is off.

private void testNotification() {
  Notification.Builder builder = new Notification.Builder(this);
  builder.setSmallIcon(R.mipmap.ic_launcher)
  .setPriority(Notification.PRIORITY_HIGH)
  .setOngoing(true);
  builder.setLights(0xff00ff00, 300, 100);
  NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  manager.notify(1, builder.build());
}

C Chase Carlile

Thank you.  I'll play around with that then. I'm assuming the scanner's beeping noise would also be controlled through the Android api?

CONTACT
Can’t find what you’re looking for?