Merge branch 'master' into develop
# Conflicts: # xpcPlugin/XPlaneConnect/mac.xpl # xpcPlugin/xpcPlugin.xcodeproj/project.pbxproj
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
|
||||
//National Aeronautics and Space Administration. All Rights Reserved.
|
||||
#ifndef XPC_MESSAGEHANDLERS_H
|
||||
#define XPC_MESSAGEHANDLERS_H
|
||||
// Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
|
||||
// National Aeronautics and Space Administration. All Rights Reserved.
|
||||
#ifndef XPCPLUGIN_MESSAGEHANDLERS_H_
|
||||
#define XPCPLUGIN_MESSAGEHANDLERS_H_
|
||||
#include "Message.h"
|
||||
|
||||
#include <string>
|
||||
@@ -10,15 +10,15 @@
|
||||
namespace XPC
|
||||
{
|
||||
/// A function that handles a message.
|
||||
typedef void(*MessageHandler)(Message&);
|
||||
typedef void(*MessageHandler)(const Message&);
|
||||
|
||||
/// Handles incommming messages and manages connections.
|
||||
/// Handles incoming messages and manages connections.
|
||||
///
|
||||
/// \author Jason Watkins
|
||||
/// \version 1.0
|
||||
/// \version 1.1
|
||||
/// \since 1.0
|
||||
/// \date Intial Version: 2015-04-12
|
||||
/// \date Last Updated: 2015-04-12
|
||||
/// \date Last Updated: 2015-05-11
|
||||
class MessageHandlers
|
||||
{
|
||||
public:
|
||||
@@ -33,21 +33,27 @@ namespace XPC
|
||||
/// \param msg The message to be processed.
|
||||
static void HandleMessage(Message& msg);
|
||||
|
||||
/// Sets the socke that message handlers use to send responses.
|
||||
/// Sets the socket that message handlers use to send responses.
|
||||
static void SetSocket(UDPSocket* socket);
|
||||
|
||||
private:
|
||||
static void HandleConn(Message& msg);
|
||||
static void HandleCtrl(Message& msg);
|
||||
static void HandleData(Message& msg);
|
||||
static void HandleDref(Message& msg);
|
||||
static void HandleGetD(Message& msg);
|
||||
static void HandlePosi(Message& msg);
|
||||
static void HandleSimu(Message& msg);
|
||||
static void HandleText(Message& msg);
|
||||
static void HandleWypt(Message& msg);
|
||||
static void HandleXPlaneData(Message& msg);
|
||||
static void HandleUnknown(Message& msg);
|
||||
// One handler per message type. Message types are descripbed on the
|
||||
// wiki at https://github.com/nasa/XPlaneConnect/wiki/Network-Information
|
||||
static void HandleConn(const Message& msg);
|
||||
static void HandleCtrl(const Message& msg);
|
||||
static void HandleData(const Message& msg);
|
||||
static void HandleDref(const Message& msg);
|
||||
static void HandleGetC(const Message& msg);
|
||||
static void HandleGetD(const Message& msg);
|
||||
static void HandleGetP(const Message& msg);
|
||||
static void HandlePosi(const Message& msg);
|
||||
static void HandleSimu(const Message& msg);
|
||||
static void HandleText(const Message& msg);
|
||||
static void HandleWypt(const Message& msg);
|
||||
static void HandleView(const Message& msg);
|
||||
|
||||
static void HandleXPlaneData(const Message& msg);
|
||||
static void HandleUnknown(const Message& msg);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user