Error opening serial port

Some thoughts about application sandboxing


            

Encouraged by the latest developments, today I started building a new application that will  allow remote connection to Kenwood TH-D74, remote control and APRS data transfer. However, while building and running the app I got the following error:

Error opening serial port … Operation not permitted(1).

If you encounter this, be aware that it is generated by application sandboxing. You can think of using App Sandbox entitlements as a two-step process:

  1. Sandbox a target, which removes most capabilities for interacting with the system
  2. Restore capabilities to the sandboxed target, as needed, by configuring App Sandbox entitlements

At runtime, if a target requires a capability or a system resource for which the target isn’t entitled, the sandbox daemon (sandboxd) logs a violation message to the console. You get this in more detail here. But it does not tell you exactly where to configure entitlements and chances are this might create some confusion. It turns out that the value to use for any of these keys is a Boolean YES or NO, with the default value in each case being NO and specifically for interaction with serial devices, the key to be used is com.apple.security.device.serial:

Select your target and edit the <target>.entitlements file adding the key as boolean and the value YES.

And the result:

Succesfully opened serial port /dev/cu.TH-D74YO3ITI-SerialPort.
Current input baud rate is 9600
Current output baud rate is 9600

 

FPGA Course

I’ve been quite busy lately and neglected the blog. I enrolled on Coursera for a very interesting FPGA course, in what seems to be a FPGA specialization from University of Colorado Boulder. I have always had somewhat a reserved attitude towards FPGAs mainly because I believed that these are hard to understand and need a […]

TH-D74 BLE or “Bluetooth Low Energy”

Struggling to understand how Universal Unique IDs work (see here) I was wrongly assuming that Core Bluetooth is a framework from Apple that covers all aspects of communication with devices via BT. I was WRONG ! scanForPeripheralsWithServices method and, in general, what I tried to do, for almost a week, is NOT good for my intended […]

Leave a Reply

Your email address will not be published. Required fields are marked *