Post

Replies

Boosts

Views

Activity

Reply to Accelerometer devices
From wikipedia, and a few related searches, it seems that accelerometer after iPhone6/plus are made on die instead of a separate sensor. https://www.wikiwand.com/en/Apple_motion_coprocessors I am also curious on what is the current G-force detection versus 3GS and 4s(search an O'REILLY post on iPhone accelerometer):"Both of these accelerometers can operate in two modes, allowing the chip to measure either ±2g and ±8g. In both modes the chip can sample at either 100 Mhz or 400 Mhz. Apple operates the accelerometer in the ±2g mode (presumably at 100 Mhz) with a nominal resolution of 0.018g. In the ±8g mode the resolution would be four times coarser, and the presumption must be that Apple decided better resolution would be more useful than a wider range." Maybe you know something about it?
Topic: App & System Services SubTopic: Hardware Tags:
Apr ’24
Reply to CoreBluetooth CBCentralManager cannot connect to discovered periphearl
Hi, thanks for helping I did not mention that xcode can install the app to WatchOS again, and was able to monitor and debug. But The issue is that I right after I click on a discovered peripheral: public func onPeripheralClicked(Peripheral per : CBPeripheral){ if central!.state == .poweredOn { central!.connect(per); print("Attempting to connect to peripheral: \(per)") } } It will just print the line above and can no longer trigger the didConnect callback: public func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) { print("connected and trying to discover services for:\(peripheral)") self.connected = true peripheral.delegate = self connectedPeripheral = peripheral connectedPeripheral?.discoverServices(nil) // Passing nil discovers all services //Timer to disconnect after action } I would provide some logs, but not sure what's the best way to provide.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’24
Reply to CoreBluetooth CBCentralManager cannot connect to discovered periphearl
I am not sure if I understand the process of creating CBPeripheral is correct but basically this is how I add to an array of peripherals during scan on central manager public func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) { if !peripherials.contains(peripheral){ self.peripherials.append(peripheral) print("Discovered peripheral: \(peripheral)") } } As for the questions: Are you using a fresh CBPeripheral object with a new scan? I think so, otherwise there would not be a call-back with a discovered peripheral object? Or are you trying to connect to a CBPeripheral that you scanned before you rebooted the Mac? I always test by rebuilding the CBPeriphearl app on MacOS and making sure its advertisement starts, when the central on WatchOS starts to scan.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’24