mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
1.1.1 Added MOBILEHTTPDEBUG command to help track failed http requests
This commit is contained in:
@@ -4,5 +4,5 @@
|
|||||||
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
||||||
[assembly: AssemblyProduct("PepperDashEssentials")]
|
[assembly: AssemblyProduct("PepperDashEssentials")]
|
||||||
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
|
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
|
||||||
[assembly: AssemblyVersion("1.1.0.*")]
|
[assembly: AssemblyVersion("1.1.1.*")]
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
long ButtonHeartbeatInterval = 1000;
|
long ButtonHeartbeatInterval = 1000;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used for tracking HTTP debugging
|
||||||
|
/// </summary>
|
||||||
|
bool HttpDebugEnabled;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -65,6 +70,8 @@ namespace PepperDash.Essentials
|
|||||||
"mobileauth", "Authorizes system to talk to cotija server", ConsoleAccessLevelEnum.AccessOperator);
|
"mobileauth", "Authorizes system to talk to cotija server", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
CrestronConsole.AddNewConsoleCommand(s => ShowInfo(),
|
CrestronConsole.AddNewConsoleCommand(s => ShowInfo(),
|
||||||
"mobileinfo", "Shows information for current mobile control session", ConsoleAccessLevelEnum.AccessOperator);
|
"mobileinfo", "Shows information for current mobile control session", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
CrestronConsole.AddNewConsoleCommand(s => { HttpDebugEnabled = (s.Trim() != "0"); },
|
||||||
|
"mobilehttpdebug", "1 enables more verbose HTTP response debugging", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -161,6 +168,8 @@ namespace PepperDash.Essentials
|
|||||||
req.Url.Parse(url);
|
req.Url.Parse(url);
|
||||||
new HttpClient().DispatchAsync(req, (r, e) =>
|
new HttpClient().DispatchAsync(req, (r, e) =>
|
||||||
{
|
{
|
||||||
|
CheckHttpDebug(r, e);
|
||||||
|
|
||||||
if (e == HTTP_CALLBACK_ERROR.COMPLETED && r.Code == 200)
|
if (e == HTTP_CALLBACK_ERROR.COMPLETED && r.Code == 200)
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "System authorized, sending config.");
|
Debug.Console(0, this, "System authorized, sending config.");
|
||||||
@@ -307,6 +316,7 @@ namespace PepperDash.Essentials
|
|||||||
/// <param name="err"></param>
|
/// <param name="err"></param>
|
||||||
void RegistrationConnectionCallback(HttpClientResponse resp, HTTP_CALLBACK_ERROR err)
|
void RegistrationConnectionCallback(HttpClientResponse resp, HTTP_CALLBACK_ERROR err)
|
||||||
{
|
{
|
||||||
|
CheckHttpDebug(resp, err);
|
||||||
Debug.Console(1, this, "RegistrationConnectionCallback: {0}", err);
|
Debug.Console(1, this, "RegistrationConnectionCallback: {0}", err);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -423,6 +433,24 @@ namespace PepperDash.Essentials
|
|||||||
ResetOrStartHearbeatTimer();
|
ResetOrStartHearbeatTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Outputs debug info when enabled
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="req"></param>
|
||||||
|
/// <param name="r"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
void CheckHttpDebug(HttpClientResponse r, HTTP_CALLBACK_ERROR e)
|
||||||
|
{
|
||||||
|
if (HttpDebugEnabled)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "HTTP Response URL: {0}", r.ResponseUrl.ToString());
|
||||||
|
Debug.Console(0, this, "----------------------------------------------------");
|
||||||
|
Debug.Console(0, this, "HTTP Response 'error' {0}", e);
|
||||||
|
Debug.Console(0, this, "HTTP Response code: {0}", r.Code);
|
||||||
|
Debug.Console(0, this, "HTTP Response content: \r{0}", r.ContentString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user