mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 20:47:08 +03:00
big merge
This commit is contained in:
49
components/spotify/cspot/include/Session.h
Normal file
49
components/spotify/cspot/include/Session.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef SESSION_H
|
||||
#define SESSION_H
|
||||
|
||||
#include <vector>
|
||||
#include <random>
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
#include <climits>
|
||||
#include <algorithm>
|
||||
#include "Utils.h"
|
||||
#include "stdlib.h"
|
||||
#include "ShannonConnection.h"
|
||||
#include "LoginBlob.h"
|
||||
#include "ApResolve.h"
|
||||
#include "PlainConnection.h"
|
||||
#include "Packet.h"
|
||||
#include "ConstantParameters.h"
|
||||
#include "Crypto.h"
|
||||
#include "ProtoHelper.h"
|
||||
|
||||
#define SPOTIFY_VERSION 0x10800000000
|
||||
#define LOGIN_REQUEST_COMMAND 0xAB
|
||||
#define AUTH_SUCCESSFUL_COMMAND 0xAC
|
||||
#define AUTH_DECLINED_COMMAND 0xAD
|
||||
|
||||
class Session
|
||||
{
|
||||
private:
|
||||
ClientResponseEncrypted authRequest;
|
||||
ClientResponsePlaintext clientResPlaintext;
|
||||
ClientHello clientHello;
|
||||
APResponseMessage apResponse;
|
||||
|
||||
std::shared_ptr<PlainConnection> conn;
|
||||
std::unique_ptr<Crypto> crypto;
|
||||
std::vector<uint8_t> sendClientHelloRequest();
|
||||
void processAPHelloResponse(std::vector<uint8_t> &helloPacket);
|
||||
|
||||
public:
|
||||
Session();
|
||||
std::shared_ptr<ShannonConnection> shanConn;
|
||||
std::shared_ptr<LoginBlob> authBlob;
|
||||
void connect(std::unique_ptr<PlainConnection> connection);
|
||||
void connectWithRandomAp();
|
||||
void close();
|
||||
std::vector<uint8_t> authenticate(std::shared_ptr<LoginBlob> blob);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user