Doug
unread,Oct 5, 2010, 8:43:00 AM10/5/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mythdroid-dev
Hi,
Modern versions of Trunk require a Token in addition to the protocol
version for the MYTH_PROTO_VERSION message. Here is a patch to
support this.
Thanks!
Doug
Index: src/org/mythdroid/backend/BackendManager.java
===================================================================
--- src/org/mythdroid/backend/BackendManager.java (revision 171)
+++ src/org/mythdroid/backend/BackendManager.java (working copy)
@@ -286,8 +286,14 @@
// Cope with odd protoVer resulting from mythtv r25366
int protoVer = MythDroid.beVersion * 1000 +
MythDroid.protoVersion;
+ String protoToken = getToken(protoVer);
- cmgr.sendString("MYTH_PROTO_VERSION " + protoVer); //$NON-
NLS-1$
+ // prefix a space for the actual request
+ if (protoToken.length() > 0) {
+ protoToken = " " + protoToken; //$NON-NLS-1$
+ }
+
+ cmgr.sendString("MYTH_PROTO_VERSION " + protoVer +
protoToken); //$NON-NLS-1$
if (!cmgr.readStringList()[0].equals("ACCEPT")) return
false; //$NON-NLS-1$
@@ -298,5 +304,24 @@
return true;
}
+
+ /**
+ * Returns the protocol token for a given protocol version.
+ * Tokens are defined in the messages.properties as:
+ * ProtoToken.<protoVer>, so just update the messages.properties
+ * for newer versions.
+ *
+ * @param protoVer
+ * @return
+ */
+ private String getToken(int protoVer) {
+ String key = "ProtoToken." + protoVer; //$NON-NLS-1$
+ String token = Messages.getString(key);
+ if (token.equals("!" + key + "!")) { //$NON-NLS-1$ //$NON-NLS-2$
+ token = ""; //$NON-NLS-1$
+ }
+
+ return token.trim();
+ }
}
Index: src/org/mythdroid/resource/messages.properties
===================================================================
--- src/org/mythdroid/resource/messages.properties (revision 171)
+++ src/org/mythdroid/resource/messages.properties (working copy)
@@ -54,6 +54,8 @@
Program.32=Never record
Program.33=Offline
Program.34=Other showing
+ProtoToken.62=78B5631E
+ProtoToken.63=3875641D
RecordingDetail.0=Type:
RecordingDetail.1=Status:
RecordingEdit.0=Failed to add/update recording