MySignal v5.2

ProAsm

Expert Member
Joined
Aug 31, 2003
Messages
2,186
<b>MySignal v5.2</b>

The (P) button has been removed to stop confusion and those with the "Original Password" problem can just add it in the MySignal.ini file where it currently says Original=None

An Auto Modem Reset has been added.
Basically if ReConnectReset is True or checked, then when ReConnectRetry reaches its count which is the number of times it does an auto Retry without success, the Modem will undergo a 'hard' reset before the next autoscan takes place.

http://www.unrealza.co.za/files/other/MySignalSetup52.zip

At some point my ftp site is changing and you will need to remove the 'za' in unrealza.


<hr noshade size="1"><center><font color="blue">MyWireless Stuff</font id="blue"></center>
 

Jedisword

Member
Joined
Aug 23, 2004
Messages
17
MySignal v5.2 is trying to find wireless modem on com5 but on my PC it's install as com3.

It can not autoreconnect,has to manually reconfigure and reconnect.

Is there any way to set it to look for wireless modem on Com3 ?

Thanks in advance
 

Jedisword

Member
Joined
Aug 23, 2004
Messages
17
ProAsm Thanks for the response

Indeed I am using Win ME (Win 98 core),I can port configure to com3 ,it works
but it can not remember the setting ,when my connection is dropped ,it will autoreconnect to com5 -again and again,my computer doesn't have anything on com4 or com5
 

ProAsm

Expert Member
Joined
Aug 31, 2003
Messages
2,186
<b>Version 5.4</b>

Now displays data in Bytes/KBytes/MBytes/GBytes.

Displays data transmitted.
Displays data received.
Displays total session data received.
Also displays this info in the Tiptext on the Taskbar Icon.
AutoStartup added to config section.
No longer resets modem indefinently after a disconnection, but teminates after 3 tries.
Will now also display the total time connected.
All the above information is now also recorded in the log.

http://www.unreal.co.za/files/other/MySignalSetup54.zip

[;)]


<hr noshade size="1"><center><font color="blue">MyWireless Stuff</font id="blue"></center>
 

Doomy

Member
Joined
Nov 30, 2003
Messages
17
Hi Pro,

Just a quicky? are u using visual c++/.net to do the mysignal and is it only usefull to usb connections or can it be tweaked to work on ethernet cable and or recompiled to linux (if source is open enough ;) ) to experiment on. i am talking about core functionality, not the interface as that is simple enough.

If not can you point me in the right direction wrt technical specs and interface details about mywireless protocol (be it modem commands or simular telnet-like session)

Thanks in advance.

Doomy
 

ProAsm

Expert Member
Joined
Aug 31, 2003
Messages
2,186
Hi Doomy,
I use Borlands C++Builder with a bit of inline assembler thrown in.
I do have an ethernet cable now and will look into this soon hopefully.
Regarding technical specs and interface etc just look up the RAS (Remote Asscess Services) in the M$ API help that comes with VCC - its all there.
The Modem commands are now all in the combo dropdown box in MySignal so that should give you the necessary.


<hr noshade size="1"><center><font color="blue">MyWireless Stuff</font id="blue"></center>
 

Doomy

Member
Joined
Nov 30, 2003
Messages
17
Hi Pro,

Thanks 4 the info. to put it this way. I am not using vc++, rather i use an freepascal(lazarus)/c++(gcc3.3.1) on linux with c++ encapsulation at the driver level to do gui object interfacing (SCADA) although i would be able to rewrite the driver interface of mysignal in c++ on linux if i have to. This is so as to create a means of easily porting it to windows/mac/linux should the need arise. I was thinking that as the windows version is rather stable and working it would be nice to also look into the smaller amount of users running mywireless exclusively on linux/mac. this being the case it does not mean i want access to you code. no... just the principle under which communications happens at the driver level so i can incorporate it into an app i am currently working on that is related to remote monitoring of mywireless modem and other remote status devices.(plc etc.)

maybe we can talk further on email...mine being doomy@dele.co.zaFRICA

I have a need to be able to monitor both the modem stability and and the latency so as to make decisions on which internet solution will render lowest latency and redundant connectivity for our remote monitoring systems.

Thanks again.
 

ProAsm

Expert Member
Joined
Aug 31, 2003
Messages
2,186
The RAS routines are the same regardless and the following code is the fundamental code for any RAS connection and works for MW as well as this was where MySignal started out.
If you compiled the following it would work ok.
The includes are supplied by M$.

<b>The Main Section</b>
Code:
//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#include &lt;ras.h&gt;
#include &lt;raserror.h&gt;
#pragma hdrstop

#include "SigMain.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TfrmMain *frmMain;
    AnsiString Winver;
    HRASCONN FRASHandle;
//---------------------------------------------------------------------------
__fastcall TfrmMain::TfrmMain(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfrmMain::FormActivate(TObject *Sender)
{
    GetEntries(0);
}
//---------------------------------------------------------------------------
VOID WINAPI RasDialFunc1(HRASCONN hrasconn, UINT unMsg, RASCONNSTATE rascs,
						 DWORD dwError, DWORD dwExtendedError)
{
	AnsiString strStatus;

	switch (rascs)
	{
		case RASCS_OpenPort:
		case RASCS_PortOpened:
            /*** update status with "Opening Port" ***/
			break;
		case RASCS_Authenticate:
		case RASCS_AuthNotify:
		case RASCS_AuthRetry:
		case RASCS_AuthCallback:
		case RASCS_AuthChangePassword:
		case RASCS_AuthProject:
		case RASCS_AuthLinkSpeed:
		case RASCS_AuthAck:
		case RASCS_ReAuthenticate:
		case RASCS_Authenticated:
		case RASCS_StartAuthentication:
		case RASCS_CallbackComplete:
            /*** update status with "Verifying User Name and Passwd" ***/
			break;
		case RASCS_LogonNetwork:
            /*** update status with "Logging In" ***/
			break;
		case RASCS_Connected:
			//RemoteAccess.OnDialSuccess();
            frmMain-&gt;OnDialSuccess();
			return;
		case RASCS_Disconnected:
			/*** update status with "Disconnected" ***/
			//RemoteAccess.m_dwDialError = dwError;
			//RemoteAccess.OnDialFailure();
			frmMain-&gt;m_dwDialError = dwError;
			frmMain-&gt;OnDialFailure();
			return;
		case RASCS_ConnectDevice:
		default:
			/*** update status with "Dialing" ***/
			break;
	}
    if (dwError != 0)
    {
        //RemoteAccess.m_dwDialError = dwError;
        //RemoteAccess.OnDialFailure();
        frmMain-&gt;m_dwDialError = dwError;
        frmMain-&gt;OnDialFailure();
    }
}
//---------------------------------------------------------------------------
void __fastcall TfrmMain::OnDialFailure()
{
	char sErrorMsg[101];
	AnsiString strMsg;
	DWORD dwRetCode;

	switch (m_dwDialError)
	{
		case ERROR_PORT_ALREADY_OPEN:
			strMsg = "Modem In Use";
			break;
		case ERROR_LINE_BUSY:
			strMsg = "Line is Busy";
			break;
		case ERROR_NO_ANSWER:
			strMsg = "No Answer";
			break;
		case ERROR_CANNOT_FIND_PHONEBOOK_ENTRY:
			strMsg = "Invalid Server Name";
			break;
		case ERROR_USER_DISCONNECTION:
			strMsg = "";
			break;          // sample only - add all other errors here
		default:
			RasGetErrorString(m_dwDialError, sErrorMsg, sizeof(sErrorMsg));
			strMsg = "Error. Check Log";
			break;
	}

	if (!strMsg.IsEmpty())
	{
		strMsg += " - " + IntToStr(m_dwDialError) + " - " + sErrorMsg;
		/*** display error string here***/
        MemoPad-&gt;Lines-&gt;Add(strMsg);
        // Hang-up the phone line
        dwRetCode = RasHangUp(m_hRasConn);
        if (dwRetCode == 0)
        {
            // The RAS connection state machine needs time to properly terminate.
            // If the system prematurely terminates the state machine, the state
            // machine may fail to properly close a port, leaving the port in an
            // inconsistent state.
            Sleep(3000);
        }
    }
}
//---------------------------------------------------------------------------
void __fastcall TfrmMain::OnDialSuccess()
{
    /*** ready for socket connection ***/
    MemoPad-&gt;Lines-&gt;Add("Successful connection");
}
//---------------------------------------------------------------------------
void __fastcall TfrmMain::DisconnectFromServer()
{
    Sleep(1000); // give the socket time to disconnect before hangup
	// Hang-up
	DWORD dwRetCode = RasHangUp(m_hRasConn);
    Sleep(3000);
    if (dwRetCode != 0)
	    m_hRasConn = NULL;
}
//---------------------------------------------------------------------------
void __fastcall TfrmMain::btnConnectClick(TObject *Sender)
{
    ConnectToServer();
}
//---------------------------------------------------------------------------
void __fastcall TfrmMain::btnDisconnectClick(TObject *Sender)
{
    DisconnectFromServer();
}
//---------------------------------------------------------------------------
void __fastcall TfrmMain::btnQuitClick(TObject *Sender)
{
    Application-&gt;Terminate();
}
//---------------------------------------------------------------------------
void __fastcall TfrmMain::GetEntries(TObject *Sender)
{
	// Enumerate the entries. This is the same
	// code used in the part 1 of the RAS
	// articles so it is not explained here.
    char eBuff[101];
	RASENTRYNAME* entries = new RASENTRYNAME[1];
	 entries[0].dwSize = sizeof(RASENTRYNAME);
	DWORD numEntries;
	DWORD size = entries[0].dwSize;
	DWORD res = RasEnumEntries(0, 0, entries, &size, &numEntries);
	if (res == ERROR_BUFFER_TOO_SMALL)
       {
	   // Allocate enough memory to get
	   // all the phonebook entries.
	   delete[] entries;
	   entries = new RASENTRYNAME[numEntries];
	   entries[0].dwSize = sizeof(RASENTRYNAME);
	   res = RasEnumEntries(0, 0, entries, &size, &numEntries);
	   if (res)
          {
	      char buff[256];
	      RasGetErrorString(res, buff, sizeof(buff));
          MemoPad-&gt;Lines-&gt;Add(buff);
	      }
	   }
    if (res != 0)
       {
       RasGetErrorString(res, eBuff, 100);
       AnsiString sTemp = eBuff;
       MemoPad-&gt;Lines-&gt;Add("Error X = " + IntToStr(res) + " = " + sTemp);
       return;
       }
	ComboBoxEntries-&gt;Items-&gt;Clear();
	for (int i=0;i&lt;(int)numEntries;i++)
		ComboBoxEntries-&gt;Items-&gt;Add(entries[i].szEntryName);
	ComboBoxEntries-&gt;ItemIndex = 0;
}
//---------------------------------------------------------------------------
bool __fastcall TfrmMain::ConnectToServer()
{
	DWORD dwRetCode;
	BOOL bPasswd;
	AnsiString strMsg;
    char sErrorMsg[101];

	// Get the dial parameters (used by RasDial)
	RasDialParams.dwSize = sizeof(RASDIALPARAMS);
    /***Enter host name as defined in dialup networking ***/
	strcpy(RasDialParams.szEntryName, EditConnection-&gt;Text.c_str());
	dwRetCode = RasGetEntryDialParams(NULL, &RasDialParams, &bPasswd);

	// Did RasGetEntryDialParams() fail?
	if (dwRetCode)
	{
        MemoPad-&gt;Lines-&gt;Add("Connection Failed!");
		m_dwDialError = dwRetCode;
		OnDialFailure();
		return(false);
	}

	strcpy(RasDialParams.szUserName, EditUsername-&gt;Text.c_str()/*** Enter user name here ***/);
	strcpy(RasDialParams.szPassword, EditPassword-&gt;Text.c_str()/*** Enter password here ***/);

	// Dial the remote server
	dwRetCode = RasDial(NULL, NULL, &RasDialParams, 1,
						(RASDIALFUNC1)RasDialFunc1, &m_hRasConn);

	// Was the dial-up completed successfully?
	if (dwRetCode)
	{
        RasGetErrorString(m_dwDialError, sErrorMsg, sizeof(sErrorMsg));
        MemoPad-&gt;Lines-&gt;Add("Connection failed!");
		m_dwDialError = dwRetCode;
		OnDialFailure();
		return(false);
	}
	else
	{
        MemoPad-&gt;Lines-&gt;Add("Connected");
        FRASHandle = m_hRasConn;
		return(true);
	}
}
//---------------------------------------------------------------------------
<b>The Header File</b>
Code:
//---------------------------------------------------------------------------
#ifndef SigMainH
#define SigMainH
#include &lt;ras.h&gt;
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
#include &lt;ComCtrls.hpp&gt;
#include &lt;ExtCtrls.hpp&gt;
//---------------------------------------------------------------------------
class TfrmMain : public TForm
{
__published:	// IDE-managed Components
    TLabel *LabelConnection;
    TLabel *LabelUsername;
    TLabel *LabelPassword;
    TEdit *EditConnection;
    TEdit *EditUsername;
    TEdit *EditPassword;
    TButton *btnQuit;
    TButton *btnConnect;
    TButton *btnDisconnect;
    TButton *btnEntries1;
    TComboBox *ComboBoxEntries;
    TMemo *MemoPad;
    void __fastcall btnQuitClick(TObject *Sender);
    void __fastcall btnConnectClick(TObject *Sender);
    void __fastcall btnDisconnectClick(TObject *Sender);
    void __fastcall FormActivate(TObject *Sender);
private:	// User declarations
	RASDIALPARAMS	RasDialParams;
    RASCONNSTATUS   RasConnStatus;
    RAS_STATS RasStats;
    void __fastcall TfrmMain::GetEntries(TObject *Sender);
public:		// User declarations
    __fastcall TfrmMain(TComponent* Owner);
	// constructors
	__fastcall TRemoteAccess();
	bool __fastcall TfrmMain::ConnectToServer(void);
	void __fastcall TfrmMain::DisconnectFromServer(void);
    void __fastcall TfrmMain::OnDialSuccess(void);
	void __fastcall TfrmMain::OnDialFailure(void);
	HRASCONN m_hRasConn;
	bool m_bDialUpConnected;
	DWORD m_dwDialError;
	AnsiString strMsg;
	AnsiString m_strServer;
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmMain *frmMain;
//---------------------------------------------------------------------------
#endif

If you need the source for a simple GUI (.dfm) I'll add that as well.


<hr noshade size="1"><center><font color="blue">MyWireless Stuff</font id="blue"></center>
 

regardtv

Expert Member
Joined
Sep 1, 2003
Messages
1,537
The only obvious comment would be that Mysignal still depends on the modem dirver as supplied by IPW ;-) ... So you'll have to use Rodent's driver as a basis
 
Top