dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] pnet/engine int_proto.h, 1.89, 1.90 int_table.c, 1


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnet/engine int_proto.h, 1.89, 1.90 int_table.c, 1.92, 1.93 lib_serial.c, 1.1, 1.2
Date: Sat, 08 Nov 2003 05:49:48 +0000

Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv2361/engine

Modified Files:
        int_proto.h int_table.c lib_serial.c 
Log Message:


Add the support routines for serial port I/O and hook up the
necessary internalcalls.


Index: lib_serial.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_serial.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** lib_serial.c        4 Nov 2003 06:51:13 -0000       1.1
--- lib_serial.c        8 Nov 2003 05:49:46 -0000       1.2
***************
*** 21,24 ****
--- 21,25 ----
  #include "engine.h"
  #include "lib_defs.h"
+ #include "il_serial.h"
  
  #ifdef        __cplusplus
***************
*** 68,73 ****
                        (ILExecThread *_thread, ILInt32 type, ILInt32 
portNumber)
  {
!       /* TODO */
!       return 0;
  }
  
--- 69,73 ----
                        (ILExecThread *_thread, ILInt32 type, ILInt32 
portNumber)
  {
!       return (ILSerialIsValid(type, portNumber) != 0);
  }
  
***************
*** 78,83 ****
                        (ILExecThread *_thread, ILInt32 type, ILInt32 
portNumber)
  {
!       /* TODO */
!       return 0;
  }
  
--- 78,82 ----
                        (ILExecThread *_thread, ILInt32 type, ILInt32 
portNumber)
  {
!       return (ILSerialIsAccessible(type, portNumber) != 0);
  }
  
***************
*** 89,94 ****
                                                                 ILInt32 
portNumber, ILObject *parameters)
  {
!       /* TODO */
!       return 0;
  }
  
--- 88,93 ----
                                                                 ILInt32 
portNumber, ILObject *parameters)
  {
!       return (ILNativeInt)ILSerialOpen
!               (type, portNumber, (ILSerialParameters *)parameters);
  }
  
***************
*** 98,102 ****
  void _IL_PortMethods_Close(ILExecThread *_thread, ILNativeInt handle)
  {
!       /* TODO */
  }
  
--- 97,101 ----
  void _IL_PortMethods_Close(ILExecThread *_thread, ILNativeInt handle)
  {
!       ILSerialClose((ILSerial *)handle);
  }
  
***************
*** 107,111 ****
                                                    ILObject *parameters)
  {
!       /* TODO */
  }
  
--- 106,110 ----
                                                    ILObject *parameters)
  {
!       ILSerialModify((ILSerial *)handle, (ILSerialParameters *)parameters);
  }
  
***************
*** 116,121 ****
                                                                           
ILNativeInt handle)
  {
!       /* TODO */
!       return 0;
  }
  
--- 115,119 ----
                                                                           
ILNativeInt handle)
  {
!       return ILSerialGetBytesToRead((ILSerial *)handle);
  }
  
***************
*** 126,131 ****
                                                                                
ILNativeInt handle)
  {
!       /* TODO */
!       return 0;
  }
  
--- 124,128 ----
                                                                                
ILNativeInt handle)
  {
!       return ILSerialGetBytesToWrite((ILSerial *)handle);
  }
  
***************
*** 135,140 ****
  ILInt32 _IL_PortMethods_ReadPins(ILExecThread *_thread, ILNativeInt handle)
  {
!       /* TODO */
!       return 0;
  }
  
--- 132,136 ----
  ILInt32 _IL_PortMethods_ReadPins(ILExecThread *_thread, ILNativeInt handle)
  {
!       return ILSerialReadPins((ILSerial *)handle);
  }
  
***************
*** 146,150 ****
                                                           ILInt32 mask, 
ILInt32 value)
  {
!       /* TODO */
  }
  
--- 142,146 ----
                                                           ILInt32 mask, 
ILInt32 value)
  {
!       ILSerialWritePins((ILSerial *)handle, mask, value);
  }
  
***************
*** 158,165 ****
                         ILInt32 *writeBufferSize, ILInt32 
*receivedBytesThreshold)
  {
!       /* TODO */
!       *readBufferSize = 1024;
!       *writeBufferSize = 1024;
!       *receivedBytesThreshold = 768;
  }
  
--- 154,159 ----
                         ILInt32 *writeBufferSize, ILInt32 
*receivedBytesThreshold)
  {
!       ILSerialGetRecommendedBufferSizes
!               (readBufferSize, writeBufferSize, receivedBytesThreshold);
  }
  
***************
*** 169,173 ****
  void _IL_PortMethods_DiscardInBuffer(ILExecThread *_thread, ILNativeInt 
handle)
  {
!       /* TODO */
  }
  
--- 163,167 ----
  void _IL_PortMethods_DiscardInBuffer(ILExecThread *_thread, ILNativeInt 
handle)
  {
!       ILSerialDiscardInBuffer((ILSerial *)handle);
  }
  
***************
*** 177,181 ****
  void _IL_PortMethods_DiscardOutBuffer(ILExecThread *_thread, ILNativeInt 
handle)
  {
!       /* TODO */
  }
  
--- 171,175 ----
  void _IL_PortMethods_DiscardOutBuffer(ILExecThread *_thread, ILNativeInt 
handle)
  {
!       ILSerialDiscardOutBuffer((ILSerial *)handle);
  }
  
***************
*** 185,189 ****
  void _IL_PortMethods_DrainOutBuffer(ILExecThread * _thread, ILNativeInt 
handle)
  {
!       /* TODO */
  }
  
--- 179,183 ----
  void _IL_PortMethods_DrainOutBuffer(ILExecThread * _thread, ILNativeInt 
handle)
  {
!       ILSerialDrainOutBuffer((ILSerial *)handle);
  }
  
***************
*** 195,200 ****
                                                         ILInt32 count)
  {
!       /* TODO */
!       return 0;
  }
  
--- 189,195 ----
                                                         ILInt32 count)
  {
!       return ILSerialRead
!               ((ILSerial *)handle,
!                ((unsigned char *)(ArrayToBuffer(buffer))) + offset, count);
  }
  
***************
*** 207,211 ****
                                                   ILInt32 count)
  {
!       /* TODO */
  }
  
--- 202,233 ----
                                                   ILInt32 count)
  {
!       ILSerialWrite
!               ((ILSerial *)handle,
!                ((const unsigned char *)(ArrayToBuffer(buffer))) + offset, 
count);
! }
! 
! /*
!  * public static int WaitForPinChange(IntPtr handle);
!  */
! ILInt32 _IL_PortMethods_WaitForPinChange(ILExecThread *_thread,
!                                                                               
 ILNativeInt handle)
! {
!       return ILSerialWaitForPinChange((ILSerial *)handle);
! }
! 
! /*
!  * public static int WaitForInput(IntPtr handle);
!  */
! ILInt32 _IL_PortMethods_WaitForInput(ILExecThread *_thread, ILNativeInt 
handle)
! {
!       return ILSerialWaitForInput((ILSerial *)handle);
! }
! 
! /*
!  * public static void Interrupt(Thread thread)
!  */
! void _IL_PortMethods_Interrupt(ILExecThread *_thread, ILObject *thread)
! {
!       ILSerialInterrupt(((System_Thread *)thread)->privateData);
  }
  

Index: int_proto.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_proto.h,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** int_proto.h 4 Nov 2003 06:51:12 -0000       1.89
--- int_proto.h 8 Nov 2003 05:49:45 -0000       1.90
***************
*** 666,669 ****
--- 666,672 ----
  extern ILInt32 _IL_PortMethods_Read(ILExecThread * _thread, ILNativeInt 
handle, System_Array * buffer, ILInt32 offset, ILInt32 count);
  extern void _IL_PortMethods_Write(ILExecThread * _thread, ILNativeInt handle, 
System_Array * buffer, ILInt32 offset, ILInt32 count);
+ extern ILInt32 _IL_PortMethods_WaitForPinChange(ILExecThread * _thread, 
ILNativeInt handle);
+ extern ILInt32 _IL_PortMethods_WaitForInput(ILExecThread * _thread, 
ILNativeInt handle);
+ extern void _IL_PortMethods_Interrupt(ILExecThread * _thread, ILObject * 
thread);
  
  extern ILInt32 _IL_IPAddress_HostToNetworkOrder_i(ILExecThread * _thread, 
ILInt32 host);

Index: int_table.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_table.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -C2 -d -r1.92 -r1.93
*** int_table.c 4 Nov 2003 06:51:13 -0000       1.92
--- int_table.c 8 Nov 2003 05:49:46 -0000       1.93
***************
*** 2874,2877 ****
--- 2874,2880 ----
        IL_METHOD("Read", "(j[Bii)i", _IL_PortMethods_Read, marshal_ipjpii)
        IL_METHOD("Write", "(j[Bii)V", _IL_PortMethods_Write, marshal_vpjpii)
+       IL_METHOD("WaitForPinChange", "(j)i", _IL_PortMethods_WaitForPinChange, 
marshal_ipj)
+       IL_METHOD("WaitForInput", "(j)i", _IL_PortMethods_WaitForInput, 
marshal_ipj)
+       IL_METHOD("Interrupt", "(oSystem.Threading.Thread;)V", 
_IL_PortMethods_Interrupt, marshal_vpp)
  IL_METHOD_END
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]