/** * Sends the pause notification. * bpAddress is a long address. */ protected static void SendPauseNotification(BreakReason reason, int bpAddress, string reasonString) { //Log.WriteLine("SendPauseNotification: reason={0}, bpAddress=0x{1:X6}, reasonString='{2}'", reason, bpAddress, reasonString); // Convert string to byte array System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); byte[] reasonBytes = enc.GetBytes(reasonString + "\0"); int stringLen = reasonBytes.Length; // Prepare data int length = 6 + stringLen; byte[] dataWoString = { // Length (byte)(length & 0xFF), (byte)((length >> 8) & 0xFF), (byte)((length >> 16) & 0xFF), (byte)(length >> 24), // SeqNo = 0 0, // PAUSE (byte)DZRP_NTF.NTF_PAUSE, // Reason (byte)reason, // Breakpoint address (long address) (byte)(bpAddress & 0xFF), (byte)((bpAddress >> 8) & 0xFF), (byte)((bpAddress >> 16) & 0xFF), }; int firstLen = dataWoString.Length; byte[] data = new byte[firstLen + stringLen]; dataWoString.CopyTo(data, 0); reasonBytes.CopyTo(data, firstLen); // Respond CSpectSocket.Send(data); }