Hi
I am trying to write "at" commands to serail port and send sms.

smsPort->Write("at"); // smsport type is System::IO::Ports::SerialPort ^smsPort;

gives me output OK

At the end(after the writing message) I need to write ctrl+z

smsPort->Write("Message");
smsPort->Write((char)26);

this gives me error

'void System::IO::Ports::SerialPort::Write(System::String ^)' : cannot convert parameter 1 from 'char' to 'System::String ^'

If I do string concat as following code it runs, but sms never sends. by doing the same thing in java I was managed to send sms.

smsPort->Write("Message" + (char)26);

The output is

> Message26

Could you please tell me how to write ctrl+z to serail port?

Thank you

Can some one please shed some light?

smsPort->Write("Message" + Convert::ToChar(26).ToString());

Milton

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.