//
//  TcpCell.m
//  JXPrinterDemo
//
//  Created by 贾俊伟 on 2022/6/23.
//

#import "TcpCell.h"

@interface TcpCell()
@property (weak, nonatomic) IBOutlet UILabel *ipLabel;
@property (weak, nonatomic) IBOutlet UIButton *connectBtn;

@end

@implementation TcpCell


- (void)setIp:(NSString *)ip {
    _ip = ip;
    self.ipLabel.text = ip;
}

- (void)setConnected:(BOOL)connected {
    _connected = connected;
    self.connectBtn.selected = connected;
}

- (IBAction)btnClick:(UIButton *)sender {
    if (self.connectBlock) {
        self.connectBlock(self.connected);
    }
}

@end
