Commit fd52a6be authored by Claes's avatar Claes

Arduino modifications

parent 1ed6ea18
...@@ -66,8 +66,9 @@ typedef struct { ...@@ -66,8 +66,9 @@ typedef struct {
#include <termios.h> #include <termios.h>
static FILE *fp; // static FILE *fp;
#if 0
static void logg( const char *str) static void logg( const char *str)
{ {
pwr_tTime t; pwr_tTime t;
...@@ -79,6 +80,7 @@ static void logg( const char *str) ...@@ -79,6 +80,7 @@ static void logg( const char *str)
fprintf( fp, "%s%04lld %s\n", timstr, t.tv_nsec/100000, str); fprintf( fp, "%s%04lld %s\n", timstr, t.tv_nsec/100000, str);
} }
#endif
typedef enum { typedef enum {
ard_eMsgType_Write = 1, ard_eMsgType_Write = 1,
...@@ -121,7 +123,7 @@ static int receive( int fd, int id, ard_sMsg *rmsg, int size) ...@@ -121,7 +123,7 @@ static int receive( int fd, int id, ard_sMsg *rmsg, int size)
msize = 0; msize = 0;
msize += read( fd, rmsg, 1); msize += read( fd, rmsg, 1);
logg( "Receive read"); // logg( "Receive read");
while ( msize < rmsg->size) { while ( msize < rmsg->size) {
sts = select(fd+1, &rfd, NULL, NULL, &tv); sts = select(fd+1, &rfd, NULL, NULL, &tv);
...@@ -129,7 +131,7 @@ static int receive( int fd, int id, ard_sMsg *rmsg, int size) ...@@ -129,7 +131,7 @@ static int receive( int fd, int id, ard_sMsg *rmsg, int size)
msize += read( fd, (char *)rmsg + msize, rmsg->size - msize); msize += read( fd, (char *)rmsg + msize, rmsg->size - msize);
logg( "Receive read ++"); // logg( "Receive read ++");
} }
...@@ -157,7 +159,7 @@ static int poll_di( ard_sMsg *msg, io_sLocal *local) ...@@ -157,7 +159,7 @@ static int poll_di( ard_sMsg *msg, io_sLocal *local)
msg->id = local->IdCnt++; msg->id = local->IdCnt++;
msg->type = ard_eMsgType_DiRead; msg->type = ard_eMsgType_DiRead;
logg( "Poll Di"); // logg( "Poll Di");
sts = write( local->fd, msg, msg->size); sts = write( local->fd, msg, msg->size);
local->DiPollId = msg->id; local->DiPollId = msg->id;
local->DiPendingPoll = 1; local->DiPendingPoll = 1;
...@@ -178,7 +180,7 @@ static pwr_tStatus IoCardInit( io_tCtx ctx, ...@@ -178,7 +180,7 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
unsigned char wdg; unsigned char wdg;
struct termios tty_attributes; struct termios tty_attributes;
fp = fopen( "/home/claes/ard.log", "w"); // Test // fp = fopen( "/home/claes/ard.log", "w"); // Test
local = (io_sLocal *) calloc( 1, sizeof(io_sLocal)); local = (io_sLocal *) calloc( 1, sizeof(io_sLocal));
cp->Local = local; cp->Local = local;
...@@ -396,6 +398,8 @@ static pwr_tStatus IoCardInit( io_tCtx ctx, ...@@ -396,6 +398,8 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
else { else {
errh_Error( "IO Init Card '%s', config error: %d", cp->Name, sts); errh_Error( "IO Init Card '%s', config error: %d", cp->Name, sts);
op->Status = sts; op->Status = sts;
if ( sts == pwr_eArduino_StatusEnum_NoMessage)
sts = pwr_eArduino_StatusEnum_ConnectionTimeout;
return IO__INITFAIL; return IO__INITFAIL;
printf( "Config read error %d\n", sts); printf( "Config read error %d\n", sts);
} }
...@@ -415,7 +419,7 @@ static pwr_tStatus IoCardClose( io_tCtx ctx, ...@@ -415,7 +419,7 @@ static pwr_tStatus IoCardClose( io_tCtx ctx,
close( local->fd); close( local->fd);
free( cp->Local); free( cp->Local);
fclose(fp); //Test // fclose(fp); //Test
return IO__SUCCESS; return IO__SUCCESS;
} }
...@@ -447,7 +451,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx, ...@@ -447,7 +451,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
msg.id = local->IdCnt++; msg.id = local->IdCnt++;
msg.type = ard_eMsgType_DiRead; msg.type = ard_eMsgType_DiRead;
logg( "Poll Di"); // logg( "Poll Di");
sts = write( local->fd, &msg, msg.size); sts = write( local->fd, &msg, msg.size);
#endif #endif
...@@ -574,7 +578,7 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx, ...@@ -574,7 +578,7 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
} }
logg( "Write Do"); // logg( "Write Do");
sts = write( local->fd, &msg, msg.size); sts = write( local->fd, &msg, msg.size);
} }
......
Volume OtherIO $ClassVolume 0.0.250.10 Volume OtherIO $ClassVolume 0.0.250.10
Body SysBody 01-JAN-1970 01:00:00.00 Body SysBody 01-JAN-1970 01:00:00.00
Attr NextOix = "_X170" Attr NextOix = "_X171"
Attr NextCix = "_X17" Attr NextCix = "_X17"
Attr NextTix[0] = "_X8" Attr NextTix[0] = "_X8"
EndBody EndBody
...@@ -374,6 +374,13 @@ Volume OtherIO $ClassVolume 0.0.250.10 ...@@ -374,6 +374,13 @@ Volume OtherIO $ClassVolume 0.0.250.10
Attr Value = 20 Attr Value = 20
EndBody EndBody
EndObject EndObject
Object ConnectionTimeout $Value 171 17-JAN-2011 18:13:00.46
Body SysBody 17-JAN-2011 18:13:05.37
Attr Text = "ConnectionTimeout"
Attr PgmName = "ConnectionTimeout"
Attr Value = 22
EndBody
EndObject
EndObject EndObject
Object Arduino_BaudRateEnum $TypeDef 6 03-JAN-2011 21:16:43.20 Object Arduino_BaudRateEnum $TypeDef 6 03-JAN-2011 21:16:43.20
Body SysBody 03-JAN-2011 21:07:09.34 Body SysBody 03-JAN-2011 21:07:09.34
......
...@@ -67,12 +67,12 @@ ...@@ -67,12 +67,12 @@
# define SET_VERSION(a, b, c, d) ((pwr_tVersion)((a << 24) + (a << 16) + (a << 8) + a)) # define SET_VERSION(a, b, c, d) ((pwr_tVersion)((a << 24) + (a << 16) + (a << 8) + a))
#endif #endif
#define pwrv_cBuildTimeStr "27-AUG-2010 12:00:00" #define pwrv_cBuildTimeStr "14-JAN-2011 20:00:00"
#define pwrv_cPwrVersionStr "V4.8.0" #define pwrv_cPwrVersionStr "V4.8.1"
#define pwrv_cPwrVersion SET_VERSION('V', 4, 8, 0) #define pwrv_cPwrVersion SET_VERSION('V', 4, 8, 1)
#define pwrv_cWbdbVersionShortStr "V48" #define pwrv_cWbdbVersionShortStr "V48"
#define pwrv_cPwrCopyright "Copyright (C) 2005-2010 SSAB Oxelsund" #define pwrv_cPwrCopyright "Copyright (C) 2005-2011 SSAB Oxelsund"
#endif #endif
Package: pwr48 Package: pwr48
Version: 4.8.0-1 Version: 4.8.1-0.1
Section: base Section: base
Priority: optional Priority: optional
Architecture: i386 Architecture: i386
...@@ -9,3 +9,7 @@ Maintainer: Proview <postmaster@proview.se> ...@@ -9,3 +9,7 @@ Maintainer: Proview <postmaster@proview.se>
Description: Proview development and runtime environment package Description: Proview development and runtime environment package
Proview development and runtime environment Proview development and runtime environment
4.8.0-1 Base release 4.8.0-1 Base release
4.8.1-0.1 Beta release
- I/O support for Arduino USB board.
- Remote support for Websphere Message Queue.
- Operator event logging and replay.
Package: pwr48 Package: pwr48
Version: 4.8.0-1 Version: 4.8.1-0.2
Section: base Section: base
Priority: optional Priority: optional
Architecture: i386 Architecture: i386
...@@ -9,3 +9,7 @@ Maintainer: Proview <postmaster@proview.se> ...@@ -9,3 +9,7 @@ Maintainer: Proview <postmaster@proview.se>
Description: Proview development and runtime environment package Description: Proview development and runtime environment package
Proview development and runtime environment Proview development and runtime environment
4.8.0-1 Base release 4.8.0-1 Base release
4.8.1-0.1 Beta release
- I/O support for Arduino USB board.
- Remote support for Websphere Message Queue.
- Operator event logging and replay.
...@@ -319,6 +319,11 @@ palette NavigatorPalette ...@@ -319,6 +319,11 @@ palette NavigatorPalette
menu USB menu USB
{ {
class USB_Agent class USB_Agent
menu Arduino
{
class Arduino_USB
class Arduino_Uno
}
menu Velleman_K8055 menu Velleman_K8055
{ {
class Velleman_K8055 class Velleman_K8055
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment