//
//  YCKSignalPacket.h
//  YCKSdwan
//
//  Created by 徐家骏 on 2019/4/26.
//  Copyright © 2019 徐家骏. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

#define YCK_DEFAULT_SIGNAL_TTL 0
#define YCKSessionManagerUserId -1

typedef NS_ENUM(uint16_t, YCKSignalCategory)
{
    YCKSignalCategoryInternal = 0,
    YCKSignalCategoryCall     = 1,
    YCKSignalCategoryMessage  = 2,
    YCKSignalCategoryCustom   = 100,
};

typedef NS_ENUM(uint16_t, YCKSignalSource)
{
    YCKSignalSourceUDP         = 1,
    YCKSignalSourcePushkit     = 2,
    YCKSignalSourceApns        = 3,
};


@interface YCKSignalPacket : NSObject

@property(nonatomic, strong)  NSMutableDictionary  *signalDict;
@property(nonatomic)          uint16_t   category;
@property(nonatomic)          int64_t    timestamp;
@property(nonatomic)          int64_t    from;
@property(nonatomic)          int64_t    to;
@property(nonatomic)          uint32_t   ttl;
@property(nonatomic, strong)  NSString  *uuid;
@property(nonatomic)   YCKSignalSource   source;

- (instancetype)init;
- (instancetype)initWithData:(NSData *)data;
- (instancetype)initWithString:(NSString *)string;
- (NSData *)toData;
- (NSString *)toString;

@end



NS_ASSUME_NONNULL_END
