Any REALBasic geeks out there? Please help with PhidgetRFID!

Supporting 10.7 and up
tschryver

Any REALBasic geeks out there? Please help with PhidgetRFID!

Postby tschryver » Wed Aug 26, 2009 11:49 pm

OK... So the trouble I am having, after tons of research and whatnot, is a funky StackOverflowException every time a card gets near the reader...

Every function seems to work fine as far as getting the serial, setting LED status, setting +5V status, etc... Its just the darn tag handler...

Declaring the OnTag_Handler:

Code: Select all

Declare Function CPhidgetRFID_set_OnTag_Handler lib "phidget21" (phid as Ptr, FunctionPointer as Ptr, UserPtr as Ptr) As Integer

Creating/connecting the device:

Code: Select all

Dim tmp As MemoryBlock
tmp = NewMemoryBlock(1000)
Dim result As Integer

Call CPhidgetRFID_create(tmp)
rfid = tmp.Ptr(0)

result = CPhidget_open(rfid, -1)
If CPhidget_waitForAttachment(rfid, 3000)<>0 Then
  MsgBox("There was an error connecting to the RFID reader!")
  Quit
End If

Setting up the event handler:

Code: Select all

Call CPhidgetRFID_set_OnTag_Handler(rfid, AddressOf TagHandler, nil)

Weird thing is, it's not even making it to the TagHandler method so I'd assume its something I'm going wrong above... Any ideas anyone? I'm at a complete loss!

Return to “macOS”

Who is online

Users browsing this forum: No registered users and 1 guest