Out of college the first work language I coded in as Wang Basic on one of these. Back in the days when memory was talked about in bytes and storage was in 'k'. (compared to today where we talk about memory in meg and gig and storage in gig and tera).
From Wang Basic I moved on to doing some work on an Atari 400 using Atari Basic and later assembly.
So I was curious when a company called Byte Works release an app called techBasic for iOS devices.
Let me say up front that entering code using an iPhone is lesson in patience but for goofing around with the iPhone techBasic is pretty interesting.
I've purchased it and am using the bluetooth 4 (BLE) hooks to try to talk to some bluetooth devices. The amount of code (compared to trying this in ObjC) is pretty small and I can debug on the fly.
This simple program:
! initialize the bluetooth handler
BLE.startBLE
! we need to start a scan, this needs a string to pass around
dim uuid(0) as string
BLE.startScan(uuid)
!
! the BLE layer uses a callback/event mechanism for handling
! bluetooth activity. This function will get called each time
! a bluetooth device is seen.
!
sub BLEDiscoveredPeripheral( time as Double,
peripheral as BLEPeripheral,
services() as string,
adverts(,) as string,
rssi as single )
print "Found a bluetooth device, name: ", peripheral.bleName,
" rssi value = ", rssi
BLE.stopScan
end sub
Now if you have a ble device in discovery or advertising mode you should get a nice printout of the device name and rssi or signal strength.
more as I drill down.
No comments:
Post a Comment