#define GST_CAT_DEFAULT cam_debug_cat
+/* Resource Manager */
+#define TAG_PROFILE_ENQUIRY 0x9F8010
+#define TAG_PROFILE_REPLY 0x9F8011
+#define TAG_PROFILE_CHANGE 0x9F8012
+
+/* Application Info */
+#define TAG_APPLICATION_INFO_ENQUIRY 0x9F8020
+#define TAG_APPLICATION_INFO_REPLY 0x9F8021
+#define TAG_APPLICATION_INFO_ENTER_MENU 0x9F8022
+
+/* Conditional Access */
+#define TAG_CONDITIONAL_ACCESS_INFO_ENQUIRY 0x9F8030
+#define TAG_CONDITIONAL_ACCESS_INFO_REPLY 0x9F8031
+#define TAG_CONDITIONAL_ACCESS_PMT 0x9F8032
+#define TAG_CONDITIONAL_ACCESS_PMT_REPLY 0x9F8033
+
+typedef struct
+{
+ guint tagid;
+ const gchar *description;
+} CamTagMessage;
+
+static CamTagMessage debugmessage[] = {
+ {TAG_PROFILE_ENQUIRY, "PROFILE_ENQUIRY"},
+ {TAG_PROFILE_REPLY, "PROFILE_REPLY"},
+ {TAG_PROFILE_CHANGE, "PROFILE_CHANGE"},
+ {TAG_APPLICATION_INFO_ENQUIRY, "APPLICATION_INFO_ENQUIRY"},
+ {TAG_APPLICATION_INFO_REPLY, "APPLICATION_INFO_REPLY"},
+ {TAG_APPLICATION_INFO_ENTER_MENU, "APPLICATION_INFO_ENTER_MENU"},
+ {TAG_CONDITIONAL_ACCESS_INFO_ENQUIRY, "CONDITIONAL_ACCESS_INFO_ENQUIRY"},
+ {TAG_CONDITIONAL_ACCESS_INFO_REPLY, "CONDITIONAL_ACCESS_INFO_REPLY"},
+ {TAG_CONDITIONAL_ACCESS_PMT, "CONDITIONAL_ACCESS_PMT"},
+ {TAG_CONDITIONAL_ACCESS_PMT_REPLY, "CONDITIONAL_ACCESS_PMT_REPLY"}
+};
+
+static inline const gchar *
+tag_get_name (guint tagid)
+{
+ guint i;
+
+ for (i = 0; i < G_N_ELEMENTS (debugmessage); i++)
+ if (debugmessage[i].tagid == tagid)
+ return debugmessage[i].description;
+ return "UNKNOWN";
+}
+
static CamReturn open_session_request_cb (CamSL * sl,
CamSLSession * session, CamSLResourceStatus * status);
static CamReturn session_opened_cb (CamSL * sl, CamSLSession * session);
guint apdu_header_length;
guint8 *apdu;
+ GST_DEBUG ("tag:0x%x (%s), buffer_size:%d, body_length:%d", tag,
+ tag_get_name (tag), buffer_size, body_length);
+
length_field_len = cam_calc_length_field_size (body_length);
apdu_header_length = 3 + length_field_len;
apdu = (buffer + buffer_size) - body_length - apdu_header_length;
return CAM_RETURN_APPLICATION_ERROR;
}
+ GST_DEBUG ("Got tag 0x%x (%s) , length:%d", tag, tag_get_name (tag), length);
+
return application->data (application, session,
tag, data + 3 + length_field_len, length);
}
#define POLL_INTERVAL 0.300
+/* Layer tags */
#define TAG_SB 0x80
#define TAG_RCV 0x81
#define TAG_CREATE_T_C 0x82
#define TAG_DATA_MORE 0xA1
#define TAG_DATA_LAST 0xA0
+/* Session tags */
+#define TAG_SESSION_NUMBER 0x90
+#define TAG_OPEN_SESSION_REQUEST 0x91
+#define TAG_OPEN_SESSION_RESPONSE 0x92
+#define TAG_CREATE_SESSION 0x93
+#define TAG_CREATE_SESSION_RESPONSE 0x94
+#define TAG_CLOSE_SESSION_REQUEST 0x95
+#define TAG_CLOSE_SESSION_RESPONSE 0x96
+
+
+typedef struct
+{
+ guint tagid;
+ const gchar *description;
+} CamTagMessage;
+
+static CamTagMessage debugmessage[] = {
+ {TAG_SB, "SB"},
+ {TAG_RCV, "RCV"},
+ {TAG_CREATE_T_C, "CREATE_T_C"},
+ {TAG_C_T_C_REPLY, "CREATE_T_C_REPLY"},
+ {TAG_DELETE_T_C, "DELETE_T_C"},
+ {TAG_D_T_C_REPLY, "DELETE_T_C_REPLY"},
+ {TAG_REQUEST_T_C, "REQUEST_T_C"},
+ {TAG_NEW_T_C, "NEW_T_C"},
+ {TAG_T_C_ERROR, "T_C_ERROR"},
+ {TAG_SESSION_NUMBER, "SESSION_NUMBER"},
+ {TAG_OPEN_SESSION_REQUEST, "OPEN_SESSION_REQUEST"},
+ {TAG_OPEN_SESSION_RESPONSE, "OPEN_SESSION_RESPONSE"},
+ {TAG_CREATE_SESSION, "CREATE_SESSION"},
+ {TAG_CREATE_SESSION_RESPONSE, "CREATE_SESSION_RESPONSE"},
+ {TAG_CLOSE_SESSION_REQUEST, "CLOSE_SESSION_REQUEST"},
+ {TAG_CLOSE_SESSION_RESPONSE, "CLOSE_SESSION_RESPONSE"},
+ {TAG_DATA_MORE, "DATA_MORE"},
+ {TAG_DATA_LAST, "DATA_LAST"}
+};
+
+static inline const gchar *
+tag_get_name (guint tagid)
+{
+ guint i;
+
+ for (i = 0; i < G_N_ELEMENTS (debugmessage); i++)
+ if (debugmessage[i].tagid == tagid)
+ return debugmessage[i].description;
+ return "UNKNOWN";
+}
+
/* utility struct used to store the state of the connections in cam_tl_read_next
*/
typedef struct
length_field_len = cam_write_length_field (&buffer[3], body_length);
buffer[3 + length_field_len] = connection->id;
- GST_DEBUG ("writing TPDU %x connection %d", buffer[2], connection->id);
+ GST_DEBUG ("writing TPDU %x (%s) connection %d (size:%d)",
+ buffer[2], tag_get_name (buffer[2]), connection->id, buffer_size);
//cam_gst_util_dump_mem (buffer, buffer_size);
tl->expected_tpdus += 1;
+ GST_DEBUG ("Sucess writing tpdu 0x%x (%s)", buffer[2],
+ tag_get_name (buffer[2]));
+
return CAM_RETURN_OK;
}
connection->has_data = FALSE;
}
- GST_DEBUG ("received TPDU %x more data %d", tpdu[2], connection->has_data);
+ GST_DEBUG ("received TPDU %x (%s) more data %d", tpdu[2],
+ tag_get_name (tpdu[2]), connection->has_data);
tl->expected_tpdus -= 1;
*out_connection = connection;