PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBPort
Wrapper Class for the IPort interface.
#include <SFBPort.h.hpp>
class SFBPort : public SFBSource;
SFMTYPEDEFWRAPPER(SFBPort)

Inheritance diagram

 Inheritance diagram of SFBPortClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
X X O O

Reference

BREW API IPort

Member

Public Functions
SFCError Close( Void )
Close an opened port or stops a open in progress.
SFCError GetLastError( Void )
Return the last error that occurred with the SFBPort.
SFCError IOCtl( SInt32 option , UInt32 val )
Allow some control over the behaviour of an SFBPort.
static
SFBPortSmp
NewInstance( SFCErrorPtr exception = null )
Create a new instance of SFBPort.
static
SFBPortSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new instance of SFBPort.
SFCError Open( ACharConstPtr port )
Open the specified prt.
SFCError Open( SFXAnsiStringConstRef port )
Open the specified prt.
SInt32 Write( ACharConstPtr port , SInt32 bufSize )
Copy bytes from the specified buffer to the source stream.
SInt32 Write( SFXAnsiStringConstRef buf )
Copy bytes from the specified buffer to the source stream.
SInt32 Write( SFXBufferConstRef buf )
Copy bytes from the specified buffer to the source stream.
Void Writeable( SFXCallbackPtr callback )
Schedule a function to be called when SFBPort::Write() would return something other than AEEPORT_WAIT.
static
Bool
Exhausted( SInt32 code ) (inherits from SFBSource)
Determine if a SFBSource, a SFBPeek, or a SFBGetLine is out of data.
SFCError QueryInterface( AEECLSID clsid , VoidHandle handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFCError QueryInterface( AEECLSID clsid , SFBBaseSmpPtr handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFBBaseSmp QueryInterface( AEECLSID clsid ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SInt32 Read( VoidPtr buf , SInt32 size ) (inherits from SFBSource)
Copy bytes from the source stream to the specified buffer.
SInt32 Read( SFXBufferPtr buf ) (inherits from SFBSource)
Copy bytes from the source stream to the specified buffer.
Void Readable( SFXCallbackPtr callback ) (inherits from SFBSource)
Schedule a callback to be called when SFBSource::Read() is able to return something other than ISOURCE_WAIT.
Void Self( AEECLSID clsidReq , SFBQuerySmpPtr clone , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SFBQuerySmp Self( AEECLSID clsidReq , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBPort::Close
Close an opened port or stops a open in progress.
[ public ]
SFCError Close(Void);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed: SFERR_FAILED
  • Port is not in open state : AEEPORT_ENOTOPEN

Reference

BREW API IPORT_Close


SFBPort::GetLastError
Return the last error that occurred with the SFBPort.
[ public ]
SFCError GetLastError(Void);

Return value

Return the error code defined in AEEError.h.

Reference

BREW API IPORT_GetLastError


SFBPort::IOCtl
Allow some control over the behaviour of an SFBPort.
[ public ]
SFCError IOCtl(
    SInt32 option   // option id
    UInt32 val      // option value
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • The option id was unrecognized: SFERR_UNSUPPORTED
  • If failed: Error code defined in AEEError.h

Reference

BREW API IPORT_IOCtl


SFBPort::NewInstance
Create a new instance of SFBPort.
[ public, static ]
SFBPortSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBPortSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBPort::Open
Open the specified prt.
[ public ]
SFCError Open(
    ACharConstPtr port   // name of the port to be opened
);
[ public ]
SFCError Open(
    SFXAnsiStringConstRef port   // name of the port to be opened
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_FAILED
  • The listenning operation is running : AEEPORT_WAIT
  • Port is currently open by some other entity : AEEPORT_EINUSE
  • The specified port name is not supported : ENOSUCH

Reference

BREW API IPORT_Open


SFBPort::Write
Copy bytes from the specified buffer to the source stream.
[ public ]
SInt32 Write(
    ACharConstPtr port   // pointer to buffer from which bytes are taken to write to the port
    SInt32 bufSize       // size of data in port
);
[ public ]
SInt32 Write(
    SFXAnsiStringConstRef buf   // pointer to buffer from which bytes are taken to write to the port
);
[ public ]
SInt32 Write(
    SFXBufferConstRef buf   // pointer to buffer from which bytes are taken to write to the port
);

Reference

BREW API IPORT_Write


SFBPort::Writeable
Schedule a function to be called when SFBPort::Write() would return something other than AEEPORT_WAIT.
[ public ]
Void Writeable(
    SFXCallbackPtr callback   // pointer to the buffer that contains the bytes to write to the port
);

Reference

BREW API IPORT_Writeable