Commit f4da6e39 authored by claes's avatar claes

GetMsg added

parent 4505f24a
...@@ -302,6 +302,8 @@ public class Gdh { ...@@ -302,6 +302,8 @@ public class Gdh {
public static native String translateFilename( String filename); public static native String translateFilename( String filename);
public native CdhrString crrSignal( String name); public native CdhrString crrSignal( String name);
public native CdhrString crrObject( String name); public native CdhrString crrObject( String name);
public native CdhrString getMsg( int sts);
public native CdhrString getMsgText( int sts);
} }
......
...@@ -62,11 +62,12 @@ public class GdhServer ...@@ -62,11 +62,12 @@ public class GdhServer
public final static int CRR_OBJECT = 43; public final static int CRR_OBJECT = 43;
public final static int GET_PARENT = 44; public final static int GET_PARENT = 44;
public final static int GET_OBJECT_INFO_OBJID = 45; public final static int GET_OBJECT_INFO_OBJID = 45;
public final static int GET_OBJECT_REF_INFO_BOOLEAN_ARRAY = 46; public final static int GET_OBJECT_REF_INFO_BOOLEAN_ARRAY = 46;
public final static int GET_OBJECT_REF_INFO_FLOAT_ARRAY = 47; public final static int GET_OBJECT_REF_INFO_FLOAT_ARRAY = 47;
public final static int GET_OBJECT_REF_INFO_INT_ARRAY = 48; public final static int GET_OBJECT_REF_INFO_INT_ARRAY = 48;
public final static int GET_OBJECT_REF_INFO_STRING_ARRAY = 49; public final static int GET_OBJECT_REF_INFO_STRING_ARRAY = 49;
public final static int GET_MSG = 50;
public final static int GET_MSG_TEXT = 51;
public final static int PORT = 4445; public final static int PORT = 4445;
...@@ -680,6 +681,10 @@ public class GdhServer ...@@ -680,6 +681,10 @@ public class GdhServer
case Pwr.eType_UInt16: case Pwr.eType_UInt16:
case Pwr.eType_Int8: case Pwr.eType_Int8:
case Pwr.eType_UInt8: case Pwr.eType_UInt8:
case Pwr.eType_Status:
case Pwr.eType_NetStatus:
case Pwr.eType_Enum:
case Pwr.eType_Mask:
if(elements > 1) if(elements > 1)
{ {
//its an array //its an array
...@@ -1283,6 +1288,41 @@ public class GdhServer ...@@ -1283,6 +1288,41 @@ public class GdhServer
System.out.println("crrObject: IO exception"); System.out.println("crrObject: IO exception");
} }
break; break;
case GET_MSG:
try
{
int status = in.readInt();
CdhrString ret = gdh.getMsg(status);
System.out.println( "getMsg : " + status + " " + ret.str);
out.writeInt(ret.getSts());
if(ret.oddSts())
{
out.writeUTF(ret.str);
}
out.flush();
}
catch(IOException e)
{
System.out.println("getMsg: IO exception");
}
break;
case GET_MSG_TEXT:
try
{
int status = in.readInt();
CdhrString ret = gdh.getMsgText(status);
out.writeInt(ret.getSts());
if(ret.oddSts())
{
out.writeUTF(ret.str);
}
out.flush();
}
catch(IOException e)
{
System.out.println("getMsg: IO exception");
}
break;
case LOG_STRING: case LOG_STRING:
try try
{ {
......
...@@ -302,6 +302,8 @@ public class Gdh { ...@@ -302,6 +302,8 @@ public class Gdh {
public static native String translateFilename( String filename); public static native String translateFilename( String filename);
public native CdhrString crrSignal( String name); public native CdhrString crrSignal( String name);
public native CdhrString crrObject( String name); public native CdhrString crrObject( String name);
public native CdhrString getMsg( int sts);
public native CdhrString getMsgText( int sts);
} }
......
...@@ -62,11 +62,12 @@ public class GdhServer ...@@ -62,11 +62,12 @@ public class GdhServer
public final static int CRR_OBJECT = 43; public final static int CRR_OBJECT = 43;
public final static int GET_PARENT = 44; public final static int GET_PARENT = 44;
public final static int GET_OBJECT_INFO_OBJID = 45; public final static int GET_OBJECT_INFO_OBJID = 45;
public final static int GET_OBJECT_REF_INFO_BOOLEAN_ARRAY = 46; public final static int GET_OBJECT_REF_INFO_BOOLEAN_ARRAY = 46;
public final static int GET_OBJECT_REF_INFO_FLOAT_ARRAY = 47; public final static int GET_OBJECT_REF_INFO_FLOAT_ARRAY = 47;
public final static int GET_OBJECT_REF_INFO_INT_ARRAY = 48; public final static int GET_OBJECT_REF_INFO_INT_ARRAY = 48;
public final static int GET_OBJECT_REF_INFO_STRING_ARRAY = 49; public final static int GET_OBJECT_REF_INFO_STRING_ARRAY = 49;
public final static int GET_MSG = 50;
public final static int GET_MSG_TEXT = 51;
public final static int PORT = 4445; public final static int PORT = 4445;
...@@ -680,6 +681,10 @@ public class GdhServer ...@@ -680,6 +681,10 @@ public class GdhServer
case Pwr.eType_UInt16: case Pwr.eType_UInt16:
case Pwr.eType_Int8: case Pwr.eType_Int8:
case Pwr.eType_UInt8: case Pwr.eType_UInt8:
case Pwr.eType_Status:
case Pwr.eType_NetStatus:
case Pwr.eType_Enum:
case Pwr.eType_Mask:
if(elements > 1) if(elements > 1)
{ {
//its an array //its an array
...@@ -1283,6 +1288,41 @@ public class GdhServer ...@@ -1283,6 +1288,41 @@ public class GdhServer
System.out.println("crrObject: IO exception"); System.out.println("crrObject: IO exception");
} }
break; break;
case GET_MSG:
try
{
int status = in.readInt();
CdhrString ret = gdh.getMsg(status);
System.out.println( "getMsg : " + status + " " + ret.str);
out.writeInt(ret.getSts());
if(ret.oddSts())
{
out.writeUTF(ret.str);
}
out.flush();
}
catch(IOException e)
{
System.out.println("getMsg: IO exception");
}
break;
case GET_MSG_TEXT:
try
{
int status = in.readInt();
CdhrString ret = gdh.getMsgText(status);
out.writeInt(ret.getSts());
if(ret.oddSts())
{
out.writeUTF(ret.str);
}
out.flush();
}
catch(IOException e)
{
System.out.println("getMsg: IO exception");
}
break;
case LOG_STRING: case LOG_STRING:
try try
{ {
......
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