Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

USB in Classic



Hi,

I had to implement code that intercepts bar code reader and slows down its events since it is too fast for some apps. Can someone confirm that my method is safe?

- I installed USB notification to get notified when device
  gets unplugged/plugged.
- I find the device, import the dispatch table (reader is like keyboard).
- I remember the current L2 interrupt handler.
- I install my own L2 interrupt handler. All that from my app.
- After a preprocess the incomming data I either call the old interrupt
  with CallSecondaryInterruptHandler2 function or just return.
- I don't do anything weird from interrupt handler.
- Is somewhere the USBKeyboardData documented? I treat it as:

  struct KeyData {
    UInt16 fKeyCount;
    struct {
      UInt8  fFlags;
      UInt8  fUsage;
    } fKey[32];
  };


- Is it safe to asssume that my interrupt handler gets removed when the device gets unplugged?



What happens if app crashes due to someone else's fault? Will system nuke in the nonexistent interrupt handler?? [docs don't say anything about it or I missed something?]



Thanks,

  Tomas
--
Ing. Tomas Zahradnicky, Jr.
Production Manager, 24U Software
Associate Member, Filemaker Solutions Alliance
mailto:email@hidden
http://www.24uSoftware.com
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.