Dear all
Is it possible to share code snippets for serial device support on AmigaOS4.
Especially writing to serial device and reading the output from serial.device ?
Thank youç
AmigaOS4 Serial Device Examples
Re: AmigaOS4 Serial Device Examples
There are some simol examples here
viewtopic.php?p=16047#p16047
Should work in all oses.
However be aware that current version of hollywood uses hardcoded the serial.device. in aos4 more or less you need to use another device (since serial.device is classic amiga internal device)
This is implemented in NEXT version of holywood
viewtopic.php?p=16047#p16047
Should work in all oses.
However be aware that current version of hollywood uses hardcoded the serial.device. in aos4 more or less you need to use another device (since serial.device is classic amiga internal device)
This is implemented in NEXT version of holywood
Christos
Re: AmigaOS4 Serial Device Examples
The sources for SerialThing helped me when doing my first program in hollywood.
SerialTing can be downloaded from http://os4depot.net/?function=showfile& ... lthing.lha
The hollywood manual was not so great at describing how to set the baudrate so i struggled quite a lot with that until i looked at the sources for serialthing.
SerialTing can be downloaded from http://os4depot.net/?function=showfile& ... lthing.lha
The hollywood manual was not so great at describing how to set the baudrate so i struggled quite a lot with that until i looked at the sources for serialthing.
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: AmigaOS4 Serial Device Examples
Sorryairsoftsoftwair wrote: ↑Wed Dec 30, 2020 11:03 pmReally? What was so unclear in the doc? Let me know and I'll try to improve it
I'm not sure if it was an user error or a bug ? :O
I'm a total n00b and have only completed one projekt with hollywood so i'm still learning how to read the manual.
But when setting up the serial connection there are some constants for baud rate etc.
I did struggle with the connection alot and tested everything i could think of.
Hollywod seemed to accept the baudrate i used (#BAUD_38400) but the recieving partner ended up with just garbage.
This made me think that the baudrate was not correctly set.
In the end i found source code for another project that helped me set the baud rate correctly.
So i ended up with this code to set the baud rate to 384000 etc.
Code: Select all
/* Create table for serial communication */
p = {} ; initialize prefs table
p.unit = 1 ; Serial.device unit 1
p.bauds = 5 ; 38400
p.bits = 3 ; 8
p.parity= 0 ; N
p.stop = 0 ; 1
p.flow = 0 ; None
Local t={
Baudrate=p.bauds, ; Serial settings table
DataBits=p.bits,
StopBits=p.stop,
Parity=p.parity,
FlowControl=p.flow
}
sid = OpenSerialPort(1,p.unit,t) ; Open serial port
I have not kept an example of how i did try to set up the connection from the beginning but i was using the #BAUD constant and hollywood seemed to gladly accept it but it did not change the baudrate.
This was on OS4 btw.
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: AmigaOS4 Serial Device Examples
But you don't have to know that! Just use the constant instead of its value, i.e.
Code: Select all
p.bauds = #BAUD_38400
Code: Select all
p.bauds = 5