Chris,
I did try connecting to the AGENT emulator using a SerialPort but got no where. I could connect the iPhone to the BLEMini and then the BLEMini to an FTDI cable. This appeared on the PC as COM3. I verified that the iPhone application would talk to the PC using a console application and data was being sent through to the PC OK.
I then modified the AGENT emulator config to contain the following:
<PhysicalSerialPort id="COM1"> <ComPortHandle>Usart1</ComPortHandle> <PhysicalPortName>COM3</PhysicalPortName></PhysicalSerialPort>
Compiling a simple test application worked OK but the events never got fired. Application on the AGENT looked like this:
public class Program{ static Bitmap _display; public static void Main() { SerialPort sp = new SerialPort("COM1", 57600, Parity.None, 8, StopBits.One); sp.DataReceived += sp_DataReceived; _display = new Bitmap(Bitmap.MaxWidth, Bitmap.MaxHeight); _display.Clear(); Font fontNinaB = Resources.GetFont(Resources.FontResources.NinaB); _display.DrawText("Hello world.", fontNinaB, Color.White, 10, 64); _display.Flush(); sp.Open(); Thread.Sleep(Timeout.Infinite); } static void sp_DataReceived(object sender, SerialDataReceivedEventArgs e) { if (e.EventType == SerialData.Chars) { byte[] buffer = new Byte[32]; int amount = ((SerialPort) sender).Read(buffer, 0, 32); if (amount > 0) { _display.Clear(); Font fontNinaB = Resources.GetFont(Resources.FontResources.NinaB); _display.DrawText(buffer[0].ToString(), fontNinaB, Color.White, 10, 64); _display.Flush(); } } }}
Regards,
Mark